Universal color-space inverse transform coding

ABSTRACT

In general, this disclosure describes techniques for coding video blocks using a color-space conversion process. A video coder, such as a video encoder or a video decoder, may determine a coding mode used to encode the video data. The coding mode may be one of a lossy coding mode or a lossless coding mode. The video coder may determine a color-space transform process dependent on the coding mode used to encode the video data. The video coder may apply the color-space transform process in encoding the video data. In decoding the video data, independent of whether the coding mode is the lossy coding mode or the lossless coding mode, the video coder may apply the same color-space inverse transform process in a decoding loop of the encoding process.

This application claims the benefit of U.S. Provisional Application No.61/953,573, filed Mar. 14, 2014, U.S. Provisional Application No.61/981,645, filed Apr. 18, 2014, and U.S. Provisional Application No.62/062,637, filed Oct. 10, 2014, the entire content each of which isincorporated herein by reference.

TECHNICAL FIELD

This disclosure relates to video coding and, more specifically, videocoding using color-space conversion.

BACKGROUND

Digital video capabilities can be incorporated into a wide range ofdevices, including digital televisions, digital direct broadcastsystems, wireless broadcast systems, personal digital assistants (PDAs),laptop or desktop computers, tablet computers, e-book readers, digitalcameras, digital recording devices, digital media players, video gamingdevices, video game consoles, cellular or satellite radio telephones,so-called “smart phones,” video teleconferencing devices, videostreaming devices, and the like. Digital video devices implement videocoding techniques, such as those described in the standards defined byMPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264/MPEG-4, Part 10, Advanced VideoCoding (AVC), the High Efficiency Video Coding (HEVC) standard presentlyunder development, and extensions of such standards. The video devicesmay transmit, receive, encode, decode, and/or store digital videoinformation more efficiently by implementing such video codingtechniques.

Video coding techniques include spatial (intra-picture) predictionand/or temporal (inter-picture) prediction to reduce or removeredundancy inherent in video sequences. For block-based video coding, avideo slice (e.g., a video frame or a portion of a video frame) may bepartitioned into video blocks, which may also be referred to astreeblocks, coding units (CUs) and/or coding nodes. Video blocks in anintra-coded (I) slice of a picture are encoded using spatial predictionwith respect to reference samples in neighboring blocks in the samepicture. Video blocks in an inter-coded (P or B) slice of a picture mayuse spatial prediction with respect to reference samples in neighboringblocks in the same picture or temporal prediction with respect toreference samples in other reference pictures. Pictures may be referredto as frames, and reference pictures may be referred to a referenceframes.

Spatial or temporal prediction results in a predictive block for a blockto be coded. Residual data represents pixel differences between theoriginal block to be coded and the predictive block. An inter-codedblock is encoded according to a motion vector that points to a block ofreference samples forming the predictive block, and the residual dataindicating the difference between the coded block and the predictiveblock. An intra-coded block is encoded according to an intra-coding modeand the residual data. For further compression, the residual data may betransformed from the pixel domain to a transform domain, resulting inresidual transform coefficients, which then may be quantized. Thequantized transform coefficients, initially arranged in atwo-dimensional array, may be scanned in order to produce aone-dimensional vector of transform coefficients, and entropy coding maybe applied to achieve even more compression.

SUMMARY

In general, this disclosure describes techniques for coding video blocksusing a color-space conversion process. A video coder, such as a videoencoder or a video decoder, may determine a coding mode used to encodethe video data. The coding mode may be one of a lossy coding mode or alossless coding mode. The video coder may determine a color-spacetransform process dependent on the coding mode used to encode the videodata. The video coder may apply the color-space transform process inencoding the video data. In decoding the video data, independent ofwhether the coding mode is the lossy coding mode or the lossless codingmode, the video coder may apply the same color-space inverse transformprocess in a decoding loop of the encoding process.

In one example, a method for decoding video data is described. Themethod comprises receiving a first encoded block of video data, whereinthe first encoded block of video data was encoded using a lossy codingmode and a first color-space transform process. The method also includesreceiving a second encoded block of video data, wherein the secondencoded block of video data was encoded using a lossless coding mode anda second color-space transform process. The method further includesapplying a color-space inverse transform process to the first encodedand applying the same color-space inverse transform process to thesecond encoded block of video data.

In another example, a device includes a memory configured to store videodata and one or more processors configured to receive a first encodedblock of video data, wherein the first encoded block of video data wasencoded using a lossy coding mode and a first color-space transformprocess. In addition, the one or more processors is also configured toreceive a second encoded block of video data, wherein the second encodedblock of video data was encoded using a lossless coding mode and asecond color-space transform process. The one or more processors isfurther configured to apply a color-space inverse transform process tothe first encoded and apply the same color-space inverse transformprocess to the second encoded block of video data.

In another example, a device includes means for receiving a firstencoded block of video data, wherein the first encoded block of videodata was encoded using a lossy coding mode and a first color-spacetransform process, and means for receiving a second encoded block ofvideo data, wherein the second encoded block of video data was encodedusing a lossless coding mode and a second color-space transform process.The device further includes means for applying a color-space inversetransform process to the first encoded block of video data and means forapplying the color-space inverse transform process to the second encodedblock of video data.

In another example, a computer-readable storage medium comprisinginstructions that, when executed, cause one or more processors toreceive a first encoded block of video data, wherein the first encodedblock of video data was encoded using a lossy coding mode and a firstcolor-space transform process, and receive a second encoded block ofvideo data, wherein the second encoded block of video data was encodedusing a lossless coding mode and a second color-space transform process.The instructions, when executed, also cause the processor to apply acolor-space inverse transform process to the first encoded block ofvideo data and apply the color-space inverse transform process to thesecond encoded block of video data.

In another example, a method for encoding video data is described. Themethod comprises determining a coding mode used to encode the videodata, wherein the coding mode is one of a lossy coding mode or alossless coding mode, and determining a color-space transform processdependent on the coding mode used to encode the video data. The methodfurther includes applying the color-space transform process to the videodata. The method also includes applying a color-space inverse transformprocess in a decoding loop of the encoding process, wherein thecolor-space inverse transform process is independent of whether thecoding mode is the lossy coding mode or the lossless coding mode.

In another example, a device includes a memory configured to store videodata and one or more processors configured to determine a coding modeused to encode the video data, wherein the coding mode is one of a lossycoding mode or a lossless coding mode, and determine a color-spacetransform process dependent on the coding mode used to encode the videodata. The one or more processors are further configured to apply thecolor-space transform process to the video data. The one or moreprocessors are also configured to apply a color-space inverse transformprocess in a decoding loop of the encoding process, wherein thecolor-space inverse transform process is independent of whether thecoding mode is the lossy coding mode or the lossless coding mode.

In another example, a device includes means for determining a codingmode used to encode the video data, wherein the coding mode is one of alossy coding mode or a lossless coding mode, and means for determining acolor-space transform process dependent on the coding mode used toencode the video data. The device further includes means for applyingthe color-space transform process to the video data. The device alsoincludes means for applying a color-space inverse transform process in adecoding loop of the encoding process, wherein the color-space inversetransform process is independent of whether the coding mode is the lossycoding mode or the lossless coding mode.

In another example, a computer-readable storage medium comprisesinstructions that, when executed, cause one or more processors todetermine a coding mode used to encode the video data, wherein thecoding mode is one of a lossy coding mode or a lossless coding mode, anddetermine a color-space transform process dependent on the coding modeused to encode the video data. The instructions further cause the one ormore processors to apply the color-space transform process to the videodata. The instructions also cause the one or more processors to apply acolor-space inverse transform process in a decoding loop of the encodingprocess, wherein the color-space inverse transform process isindependent of whether the coding mode is the lossy coding mode or thelossless coding mode.

The details of one or more examples of the disclosure are set forth inthe accompanying drawings and the description below. Other features,objects, and advantages of the disclosure will be apparent from thedescription and drawings, and from the claims.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating an example video encoding anddecoding system that may utilize the techniques described in thisdisclosure.

FIG. 2 is block diagram illustrating an example video encoder that mayimplement the techniques described in this disclosure.

FIG. 3 is a block diagram illustrating an example video decoder that mayimplement the techniques described in this disclosure.

FIG. 4 is a conceptual diagram illustrating the 35 HEVC prediction modesaccording to one or more techniques of the current disclosure.

FIG. 5 is a conceptual diagram illustrating spatial neighboring motionvector candidates for merge and advanced motion vector prediction (AMVP)modes according to one or more techniques of the current disclosure.

FIG. 6 is a conceptual diagram illustrating an intra block copy (BC)example according to one or more techniques of the current disclosure.

FIG. 7 is a conceptual diagram illustrating an example of a target blockand reference sample for an intra 8×8 block, according to one or moretechniques of the current disclosure.

FIG. 8 is a flow diagram illustrating an encoding technique according toone or more techniques of the current disclosure.

FIG. 9 is a flow diagram illustrating a decoding technique according toone or more techniques of the current disclosure.

DETAILED DESCRIPTION

In some examples, this disclosure is related to screen content coding,wherein high chroma sampling format 4:4:4 is used. In some examples,this disclosure is also applicable for range extensions (RCEx),including the support of possibly high bit depth, (more than 8 bit),high chroma sampling format 4:4:4. In some examples, this disclosure isalso applicable to other color formats, such as chroma sampling formatis 4:2:2. More specifically, in this disclosure, many differenttechniques related to color-space conversion are described.

Video coding standards include ITU-T H.261, ISO/IEC MPEG-1 Visual, ITU-TH.262 or ISO/IEC MPEG-2 Visual, ITU-T H.263, ISO/IEC MPEG-4 Visual andITU-T H.264 (also known as ISO/IEC MPEG-4 AVC), including its ScalableVideo Coding (SVC) and Multiview Video Coding (MVC) extensions.

The design of a new video coding standard, namely High-Efficiency VideoCoding (HEVC), has been finalized by the Joint Collaboration Team onVideo Coding (JCT-VC) of ITU-T Video Coding Experts Group (VCEG) andISO/IEC Motion Picture Experts Group (MPEG).

In HEVC, the largest coding unit in a slice is called a coding treeblock (CTB). A CTB contains a quad-tree the nodes of which are codingunits. The size of a CTB can range from 16×16 to 64×64 in the HEVC mainprofile, although 8×8 CTB sizes can be supported. A coding unit (CU)could be the same size as a CTB and as small as 8×8. Each CU is codedwith one mode. When a CU is inter coded, the CU may be furtherpartitioned into two prediction units (PUs) or become a single PU whenfurther partitions do not apply. When two PUs are present in one CU,each PU can be half size rectangles or two rectangles with a size equalto ¼ or ¾ the size of the CU.

When the CU is inter coded, one set of motion information is present foreach PU. In addition, each PU is coded with a unique inter-predictionmode to derive the set of motion information. In HEVC, the smallest PUsizes are 8×4 and 4×8.

HEVC specifies four transform units (TUs) with sizes of 4×4, 8×8, 16×16,and 32×32 to code the prediction residual. A CTB may be recursivelypartitioned into 4 or more TUs. TUs use integer-based functions that aresimilar to discrete cosine transform (DCT) functions. In addition, 4×4luma transform blocks that belong to an intra coded region aretransformed using an integer transform that is derived from a discretesine transform (DST) function. Chroma uses the same TU sizes as luma.

In the current HEVC standard, for the luma component of each PredictionUnit (PU), an intra prediction method is utilized with 33 angularprediction modes (indexed from 2 to 34), a DC mode (indexed with 1), anda Planar mode (indexed with 0), as described below with respect to FIG.4.

In addition to the above 35 intra modes, one more mode, named ‘I-PCM’,is also employed by HEVC. In I-PCM mode, prediction, transform,quantization, and entropy coding are bypassed while the predictionsamples are coded by a predefined number of bits. The main purpose ofthe I-PCM mode is to handle the situation when the signal cannot beefficiently coded by other modes.

In the current HEVC standard, there are two inter prediction modesavailable. One such mode is merge mode (skip is considered as a specialcase of merge), and the second such mode is advanced motion vectorprediction (AMVP) mode for a prediction unit (PU).

In both AMVP and merge mode, a motion vector (MV) candidate list ismaintained for multiple motion vector predictors. The motion vector(s),as well as reference indices in the merge mode, of the current PU aregenerated by taking one candidate from the MV candidate list.

The MV candidate list may contain up to 5 candidates for the merge modeand only two candidates for the AMVP mode. A merge candidate may containa set of motion information, e.g., motion vectors corresponding to bothreference picture lists (list 0 and list 1) and the reference indices.If a merge candidate is identified by a merge index, the referencepictures are used for the prediction of the current blocks, as well asthe associated motion vectors are determined. However, under AMVP modefor each potential prediction direction from either list 0 or list 1, areference index needs to be explicitly signaled, together with an MVPindex to the MV candidate list since the AMVP candidate contains only amotion vector. In AMVP mode, the predicted motion vectors can be furtherrefined.

A merge candidate corresponds to a full set of motion information whilean AMVP candidate may contain just one motion vector for a specificprediction direction and reference index. The candidates for both modesare derived similarly from the same spatial and temporal neighboringblocks.

As described below with respect to FIG. 5, spatial MV candidates arederived from the neighboring blocks shown on FIG. 5, for a specific PU(PU0). However, the methods generating the candidates from the blocksdiffer for merge and AMVP modes.

In merge mode, up to four spatial MV candidates can be derived with theorders showed on FIG. 5( a) with numbers. The order is as follows: left(0), above (1), above right (2), below left (3), and above left (4), asshown in FIG. 5( a).

In AMVP mode, the neighboring blocks are divided into two groups: a leftgroup including block 0 and 1, and an above group including the blocks2, 3, and 4 as shown on FIG. 5( b). For each group, the potentialcandidate in a neighboring block referring to the same reference pictureas that indicated by the signaled reference index has the highestpriority to be chosen to form a final candidate of the group. It ispossible that all neighboring blocks do not contain a motion vectorpointing to the same reference picture. Therefore, if such a candidatecannot be found, the first available candidate will be scaled to formthe final candidate, thus the temporal distance differences can becompensated.

As described below with respect to FIG. 6, the Intra Block-Copy (BC) hasbeen included in SCC. An example of Intra BC is shown in FIG. 6, whereinthe current CU is predicted from an already decoded block of the currentpicture/slice. The current Intra BC block size can be as large as a CUsize, which ranges from 8×8 to 64×64, although in some applications,further constrains may apply.

In some examples, an in-loop color-space transform process for residualsignals can be used for sequences in 4:4:4 chroma format. This methodtransforms prediction error signals in RGB/YUV chroma format into thosein a sub-optimal color-space. With this additional step, the correlationamong the color components could be further reduced. The transformmatrix is derived from pixel sample values for each coding unit by asingular-value-decomposition (SVD). The color-space transform is appliedto prediction error of both intra and inter mode.

In some examples, when the color-space transform process is applied tointer mode, the residual is firstly converted to a different domain withthe derived transform matrix. After the color-space conversion, theconventional coding steps, such as DCT/DST, quantization, and entropycoding are performed in order.

In some examples, when the color-space transform process is applied tointra mode, the prediction and current block are firstly converted to adifferent domain with the derived transform matrix, respectively. Afterthe color-space conversion, the residual between current block and itspredictor is further transformed with DCT/DST, quantized, and entropycoded.

In the forward operation, a color-space transform matrix is applied tothe three planes G, B, and R as follows:

${\begin{bmatrix}a & b & c \\d & e & f \\g & h & i\end{bmatrix}\begin{bmatrix}G \\B \\R\end{bmatrix}} = {\begin{bmatrix}P \\Q \\S\end{bmatrix}.}$

Resulting values are clipped within the range of the HEVC specificationbecause, in some examples, values are enlarged up to √{square root over(3)} times. In the inverse operation, a color-space transform matrix isapplied to the three components P′, Q′, and R′ as follows,

${\begin{bmatrix}a & b & c \\d & e & f \\g & h & i\end{bmatrix}^{t}\begin{bmatrix}P^{\prime} \\Q^{\prime} \\S^{\prime}\end{bmatrix}} = {\begin{bmatrix}G^{\prime} \\B^{\prime} \\R^{\prime}\end{bmatrix}.}$

As described below with respect to FIG. 7, a transform matrix may bederived from the reference sample values. Different reference samplescan be utilized for the intra case and inter case. For the case of anintra coded block, a target block and reference samples are shown inFIG. 7. In this example, the target block consists of 8×8 crosshatchedsamples and reference samples are striped and dotted samples.

For the case of an inter coded block, reference samples for the matrixderivation are the same as the reference samples for motioncompensation. In order to realize the shift operation, reference samplesin the AMP block are sub-sampled such that the number of samples becomesthe power-of-two. For example, the number of reference samples in a12×16 block are reduced by ⅔.

According to the techniques of the current disclosure, the color-spacetransform process may be applied for each CU. Therefore, there is noneed to signal whether the transform process is invoked or not. Inaddition, both the encoder and decoder sides derive the transform matrixwith the same method to avoid the overhead for signaling the transformmatrix.

According to techniques of the current disclosure, color-space transformprocesses, such as color-space transform matrices, are used. One suchmatrix is the YCbCr transform matrix, which is:

${{Forward}{\text{:}\mspace{14mu}\begin{bmatrix}Y \\{Cb} \\{Cr}\end{bmatrix}}} = {\begin{bmatrix}0.2126 & 0.7152 & 0.0722 \\{- 0.1172} & {- 0.3942} & 0.5114 \\0.5114 & {- 0.4645} & {- 0.0469}\end{bmatrix}\begin{bmatrix}R \\G \\B\end{bmatrix}}$ ${{Inverse}{\text{:}\mspace{14mu}\begin{bmatrix}R \\G \\B\end{bmatrix}}} = {\begin{bmatrix}1 & 0 & 1.5397 \\1 & {- 0.1831} & {- 0.4577} \\1 & 1.8142 & 0\end{bmatrix}\begin{bmatrix}Y \\{Cb} \\{Cr}\end{bmatrix}}$

Another such matrix is the YCoCg transform matrix, which is:

${{Forward}{\text{:}\mspace{14mu}\begin{bmatrix}Y \\{Co} \\{Cg}\end{bmatrix}}} = {\begin{bmatrix}{1/4} & {1/2} & {1/4} \\{1/2} & 0 & {{- 1}/2} \\{{- 1}/4} & {1/2} & {{- 1}/4}\end{bmatrix}\begin{bmatrix}R \\G \\B\end{bmatrix}}$ ${{Inverse}{\text{:}\mspace{14mu}\begin{bmatrix}R \\G \\B\end{bmatrix}}} = {\begin{bmatrix}1 & 1 & {- 1} \\1 & 0 & 1 \\1 & {- 1} & {- 1}\end{bmatrix}\begin{bmatrix}Y \\{Co} \\{Cg}\end{bmatrix}}$

Another such matrix is the YCoCg-R matrix, which is a revised version ofthe YCoCg matrix which scales the Co and Cg components by a factor oftwo. By using a lifting technique, the forward and inverse transformcould be achieved by the following equations:

Co=R−B

t=B+└Co/2┘

Cg=G−t

Y=t+└Cg/2┘  Forward:

t=Y−└Cg/2┘

G=Cg+t

B=t−└Co/2┘

R=B+Co  Inverse:

In the above equations and matrices, the forward transformations may beperformed during the encoding process (e.g., by a video encoder), andthe inverse transformations may be performed in the decoding process(e.g., by a video decoder).

In traditional video coding, images are assumed to have a continuoustone and be spatially smooth. Based on these assumptions, various toolshave been developed (e.g., block-based transform, filtering, etc.) whichhave shown good performance for videos with natural content. However, incertain applications (e.g., a remote desktop, collaborative workdisplays, and wireless displays), computer generated screen content maybe the dominant content to be compressed. This type of content tends tohave a discrete tone and feature sharp lines and high-contrast objectboundaries. The assumption of continuous-tone and smoothness may nolonger apply and, thus, traditional video coding techniques may not workefficiently.

Palette mode coding may be used to overcome the above deficiencies.Examples of the palette coding techniques are described in U.S.Provisional Application Ser. No. 61/810,649, filed Apr. 10, 2013. Foreach CU, a palette may be derived, which includes the most dominantpixel values in the current CU. The size and the elements of the paletteare first transmitted. After the transmission, the pixels in the CU areencoded according to a certain scanning order. For each location, asyntax element, such as a flag, palette_flag, is first transmitted toindicate if the pixel value is in the palette (“run mode”) or not(“pixel mode”).

In “run mode”, the palette index may be signaled, followed by the “run”.The run is a syntax element which indicates the number of consecutivepixels in a scanning order that have the same palette index value as thepixel currently being coded. If multiple pixels in immediate successionin the scanning order have the same palette index value, then “run mode”may be indicated by the syntax element, such as palette_flag. A countervalue may be determined, which equals the number of pixels succeedingthe current pixel that have the same palette index value as the currentpixel, and the run is set equal to the counter value. Neitherpalette_flag nor the palette index needs to be transmitted for thefollowing positions that are covered by the “run” as they all have thesame pixel value. On the decoder side, only the first palette indexvalue for the current pixel would be decoded, and the result would beduplicated for each pixel in the “run” of pixels indicated in the “run”syntax element.

In “pixel mode”, the pixel sample value is transmitted for thisposition. If the syntax element, such as palette_flag, indicates “pixelmode”, then the palette index value is only determined for the one pixelbeing decoded.

Conventional techniques may suffer from various problems. For instance,a color-space transform may be invoked which does not take into accountthe sequence characteristics and local diversity. Therefore, the codingperformance may be sub-optimal. In another example, the derivation of atransform matrix may be required at the decoder, which increases thedecoder complexity significantly. Further, the transform matrix may bederived using either the spatial reconstructed pixels or the predictorof inter-coded PUs. However, the efficiency of the transform matrix maybe reduced when the PU size is relatively small, the prediction is notvery accurate, or the neighboring pixels are unavailable. Techniques ofthis disclosure may overcome one or more of these problems.

A video coder, such as video encoder 20 or video decoder 30, may executetechniques described in this disclosure. In general, this disclosuredescribes techniques for coding video blocks using a color-spaceconversion process. A video coder, such as video encoder 20 or videodecoder 30, may determine a coding mode used to encode the video data.The coding mode may be one of a lossy coding mode or a lossless codingmode. The video coder may determine a color-space transform processdependent on the coding mode used to encode the video data. The videocoder may apply the color-space transform process in encoding the videodata. In decoding the video data, independent of whether the coding modeis the lossy coding mode or the lossless coding mode, the video codermay apply the same color-space inverse transform process in a decodingloop of the encoding process.

This disclosure describes techniques that may improve the codingperformance of in-loop color-space transform and may reduce the decodercomplexity. FIG. 1 is a block diagram illustrating an example videoencoding and decoding system 10 that may utilize techniques for screencontent coding, wherein high a chroma sampling format is used. As shownin FIG. 1, system 10 includes a source device 12 that provides encodedvideo data to be decoded at a later time by a destination device 14. Inparticular, source device 12 provides the video data to destinationdevice 14 via a computer-readable medium 16. Source device 12 anddestination device 14 may comprise any of a wide range of devices,including desktop computers, notebook (i.e., laptop) computers, tabletcomputers, set-top boxes, telephone handsets such as so-called “smart”phones, so-called “smart” pads, televisions, cameras, display devices,digital media players, video gaming consoles, video streaming device, orthe like. In some cases, source device 12 and destination device 14 maybe equipped for wireless communication.

Destination device 14 may receive the encoded video data to be decodedvia computer-readable medium 16. Computer-readable medium 16 maycomprise any type of medium or device capable of moving the encodedvideo data from source device 12 to destination device 14. In oneexample, computer-readable medium 16 may comprise a communication mediumto enable source device 12 to transmit encoded video data directly todestination device 14 in real-time. The encoded video data may bemodulated according to a communication standard, such as a wirelesscommunication protocol, and transmitted to destination device 14. Thecommunication medium may comprise any wireless or wired communicationmedium, such as a radio frequency (RF) spectrum or one or more physicaltransmission lines. The communication medium may form part of apacket-based network, such as a local area network, a wide-area network,or a global network such as the Internet. The communication medium mayinclude routers, switches, base stations, or any other equipment thatmay be useful to facilitate communication from source device 12 todestination device 14.

In some examples, encoded data may be output from output interface 22 toa storage device. Similarly, encoded data may be accessed from thestorage device by input interface. The storage device may include any ofa variety of distributed or locally accessed data storage media such asa hard drive, Blu-ray discs, DVDs, CD-ROMs, flash memory, volatile ornon-volatile memory, or any other suitable digital storage media forstoring encoded video data. In a further example, the storage device maycorrespond to a file server or another intermediate storage device thatmay store the encoded video generated by source device 12. Destinationdevice 14 may access stored video data from the storage device viastreaming or download. The file server may be any type of server capableof storing encoded video data and transmitting that encoded video datato the destination device 14. Example file servers include a web server(e.g., for a website), an FTP server, network attached storage (NAS)devices, or a local disk drive. Destination device 14 may access theencoded video data through any standard data connection, including anInternet connection. This may include a wireless channel (e.g., a Wi-Ficonnection), a wired connection (e.g., DSL, cable modem, etc.), or acombination of both that is suitable for accessing encoded video datastored on a file server. The transmission of encoded video data from thestorage device may be a streaming transmission, a download transmission,or a combination thereof.

The techniques of this disclosure are not necessarily limited towireless applications or settings. The techniques may be applied tovideo coding in support of any of a variety of multimedia applications,such as over-the-air television broadcasts, cable televisiontransmissions, satellite television transmissions, Internet streamingvideo transmissions, such as dynamic adaptive streaming over HTTP(DASH), digital video that is encoded onto a data storage medium,decoding of digital video stored on a data storage medium, or otherapplications. In some examples, system 10 may be configured to supportone-way or two-way video transmission to support applications such asvideo streaming, video playback, video broadcasting, and/or videotelephony.

In the example of FIG. 1, source device 12 includes video source 18,video encoder 20, and output interface 22. Destination device 14includes input interface 28, video decoder 30, and display device 32. Inaccordance with this disclosure, video encoder 20 of source device 12may be configured to apply the techniques for coding video blocks usinga color-space conversion process. In other examples, a source device anda destination device may include other components or arrangements. Forexample, source device 12 may receive video data from an external videosource 18, such as an external camera. Likewise, destination device 14may interface with an external display device, rather than including anintegrated display device.

The illustrated system 10 of FIG. 1 is merely one example. Techniquesfor coding video blocks using a color-space conversion process may beperformed by any digital video encoding and/or decoding device. Althoughgenerally the techniques of this disclosure are performed by a videoencoding device, the techniques may also be performed by a videoencoder/decoder, typically referred to as a “CODEC.” Moreover, thetechniques of this disclosure may also be performed by a videopreprocessor. Source device 12 and destination device 14 are merelyexamples of such coding devices in which source device 12 generatescoded video data for transmission to destination device 14. In someexamples, devices 12, 14 may operate in a substantially symmetricalmanner such that each of devices 12, 14 include video encoding anddecoding components. Hence, system 10 may support one-way or two-wayvideo transmission between video devices 12, 14, e.g., for videostreaming, video playback, video broadcasting, or video telephony.

Video source 18 of source device 12 may include a video capture device,such as a video camera, a video archive containing previously capturedvideo, and/or a video feed interface to receive video from a videocontent provider. As a further alternative, video source 18 may generatecomputer graphics-based data as the source video, or a combination oflive video, archived video, and computer-generated video. In some cases,if video source 18 is a video camera, source device 12 and destinationdevice 14 may form so-called camera phones or video phones. As mentionedabove, however, the techniques described in this disclosure may beapplicable to video coding in general, and may be applied to wirelessand/or wired applications. In each case, the captured, pre-captured, orcomputer-generated video may be encoded by video encoder 20. The encodedvideo information may then be output by output interface 22 onto acomputer-readable medium 16.

Computer-readable medium 16 may include transient media, such as awireless broadcast or wired network transmission, or storage media (thatis, non-transitory storage media), such as a hard disk, flash drive,compact disc, digital video disc, Blu-ray disc, or othercomputer-readable media. In some examples, a network server (not shown)may receive encoded video data from source device 12 and provide theencoded video data to destination device 14, e.g., via networktransmission. Similarly, a computing device of a medium productionfacility, such as a disc stamping facility, may receive encoded videodata from source device 12 and produce a disc containing the encodedvideo data. Therefore, computer-readable medium 16 may be understood toinclude one or more computer-readable media of various forms, in variousexamples.

Input interface 28 of destination device 14 receives information fromcomputer-readable medium 16. The information of computer-readable medium16 may include syntax information defined by video encoder 20, which isalso used by video decoder 30, that includes syntax elements thatdescribe characteristics and/or processing of blocks and other codedunits, e.g., GOPs. Display device 32 displays the decoded video data toa user, and may comprise any of a variety of display devices such as acathode ray tube (CRT), a liquid crystal display (LCD), a plasmadisplay, an organic light emitting diode (OLED) display, or another typeof display device.

Video encoder 20 and video decoder 30 may operate according to a videocoding standard, such as the High Efficiency Video Coding (HEVC)standard presently under development, and may conform to the HEVC TestModel (HM). Alternatively, video encoder 20 and video decoder 30 mayoperate according to other proprietary or industry standards, such asthe ITU-T H.264 standard, alternatively referred to as MPEG-4, Part 10,Advanced Video Coding (AVC), or extensions of such standards. Thetechniques of this disclosure, however, are not limited to anyparticular coding standard. Other examples of video coding standardsinclude MPEG-2 and ITU-T H.263. Although not shown in FIG. 1, in someaspects, video encoder 20 and video decoder 30 may each be integratedwith an audio encoder and decoder, and may include appropriate MUX-DEMUXunits, or other hardware and software, to handle encoding of both audioand video in a common data stream or separate data streams. Ifapplicable, MUX-DEMUX units may conform to the ITU H.223 multiplexerprotocol, or other protocols such as the user datagram protocol (UDP).

The ITU-T H.264/MPEG-4 (AVC) standard was formulated by the ITU-T VideoCoding Experts Group (VCEG) together with the ISO/IEC Moving PictureExperts Group (MPEG) as the product of a collective partnership known asthe Joint Video Team (JVT). In some aspects, the techniques described inthis disclosure may be applied to devices that generally conform to theH.264 standard. The H.264 standard is described in ITU-T RecommendationH.264, Advanced Video Coding for generic audiovisual services, by theITU-T Study Group, and dated March, 2005, which may be referred toherein as the H.264 standard or H.264 specification, or the H.264/AVCstandard or specification. The Joint Video Team (JVT) continues to workon extensions to H.264/MPEG-4 AVC.

Video encoder 20 and video decoder 30 each may be implemented as any ofa variety of suitable encoder circuitry, such as one or moremicroprocessors, digital signal processors (DSPs), application specificintegrated circuits (ASICs), field programmable gate arrays (FPGAs),discrete logic, software, hardware, firmware or any combinationsthereof. When the techniques are implemented partially in software, adevice may store instructions for the software in a suitable,non-transitory computer-readable medium and execute the instructions inhardware using one or more processors to perform the techniques of thisdisclosure. Each of video encoder 20 and video decoder 30 may beincluded in one or more encoders or decoders, either of which may beintegrated as part of a combined encoder/decoder (CODEC) in a respectivedevice.

The JCT-VC is working on development of the HEVC standard. The HEVCstandardization efforts are based on an evolving model of a video coderreferred to as the HEVC Test Model (HM). The HM presumes severaladditional capabilities of video coders relative to existing devicesaccording to, e.g., ITU-T H.264/AVC. For example, whereas H.264 providesnine intra-prediction encoding modes, the HM may provide as many asthirty-three intra-prediction encoding modes.

In general, the working model of the HM describes that a video frame orpicture may be divided into a sequence of treeblocks or largest codingunits (LCU) that include both luma and chroma samples. Syntax datawithin a bitstream may define a size for the LCU, which is a largestcoding unit in terms of the number of pixels. A slice includes a numberof consecutive treeblocks in coding order. A video frame or picture maybe partitioned into one or more slices. Each treeblock may be split intocoding units (CUs) according to a quadtree. In general, a quadtree datastructure includes one node per CU, with a root node corresponding tothe treeblock. If a CU is split into four sub-CUs, the nodecorresponding to the CU includes four leaf nodes, each of whichcorresponds to one of the sub-CUs.

Each node of the quadtree data structure may provide syntax data for thecorresponding CU. For example, a node in the quadtree may include asplit flag, indicating whether the CU corresponding to the node is splitinto sub-CUs. Syntax elements for a CU may be defined recursively, andmay depend on whether the CU is split into sub-CUs. If a CU is not splitfurther, it is referred as a leaf-CU. In this disclosure, four sub-CUsof a leaf-CU will also be referred to as leaf-CUs even if there is noexplicit splitting of the original leaf-CU. For example, if a CU at16×16 size is not split further, the four 8×8 sub-CUs will also bereferred to as leaf-CUs although the 16×16 CU was never split.

A CU has a similar purpose as a macroblock of the H.264 standard, exceptthat a CU does not have a size distinction. For example, a treeblock maybe split into four child nodes (also referred to as sub-CUs), and eachchild node may in turn be a parent node and be split into another fourchild nodes. A final, unsplit child node, referred to as a leaf node ofthe quadtree, comprises a coding node, also referred to as a leaf-CU.Syntax data associated with a coded bitstream may define a maximumnumber of times a treeblock may be split, referred to as a maximum CUdepth, and may also define a minimum size of the coding nodes.Accordingly, a bitstream may also define a smallest coding unit (SCU).This disclosure uses the term “block” to refer to any of a CU, PU, orTU, in the context of HEVC, or similar data structures in the context ofother standards (e.g., macroblocks and sub-blocks thereof in H.264/AVC).

A CU includes a coding node and prediction units (PUs) and transformunits (TUs) associated with the coding node. A size of the CUcorresponds to a size of the coding node and must be square in shape.The size of the CU may range from 8×8 pixels up to the size of thetreeblock with a maximum of 64×64 pixels or greater. Each CU may containone or more PUs and one or more TUs. Syntax data associated with a CUmay describe, for example, partitioning of the CU into one or more PUs.Partitioning modes may differ between whether the CU is skip or directmode encoded, intra-prediction mode encoded, or inter-prediction modeencoded. PUs may be partitioned to be non-square in shape. Syntax dataassociated with a CU may also describe, for example, partitioning of theCU into one or more TUs according to a quadtree. A TU can be square ornon-square (e.g., rectangular) in shape.

The HEVC standard allows for transformations according to TUs, which maybe different for different CUs. The TUs are typically sized based on thesize of PUs within a given CU defined for a partitioned LCU, althoughthis may not always be the case. The TUs are typically the same size orsmaller than the PUs. In some examples, residual samples correspondingto a CU may be subdivided into smaller units using a quadtree structureknown as “residual quad tree” (RQT). The leaf nodes of the RQT may bereferred to as transform units (TUs). Pixel difference values associatedwith the TUs may be transformed to produce transform coefficients, whichmay be quantized.

A leaf-CU may include one or more prediction units (PUs). In general, aPU represents a spatial area corresponding to all or a portion of thecorresponding CU, and may include data for retrieving a reference samplefor the PU. Moreover, a PU includes data related to prediction. Forexample, when the PU is intra-mode encoded, data for the PU may beincluded in a residual quadtree (RQT), which may include data describingan intra-prediction mode for a TU corresponding to the PU. As anotherexample, when the PU is inter-mode encoded, the PU may include datadefining one or more motion vectors for the PU. The data defining themotion vector for a PU may describe, for example, a horizontal componentof the motion vector, a vertical component of the motion vector, aresolution for the motion vector (e.g., one-quarter pixel precision orone-eighth pixel precision), a reference picture to which the motionvector points, and/or a reference picture list (e.g., List 0, List 1, orList C) for the motion vector.

A leaf-CU having one or more PUs may also include one or more transformunits (TUs). The transform units may be specified using an RQT (alsoreferred to as a TU quadtree structure), as discussed above. Forexample, a split flag may indicate whether a leaf-CU is split into fourtransform units. Then, each transform unit may be split further intofurther sub-TUs. When a TU is not split further, it may be referred toas a leaf-TU. Generally, for intra coding, all the leaf-TUs belonging toa leaf-CU share the same intra prediction mode. That is, the sameintra-prediction mode is generally applied to calculate predicted valuesfor all TUs of a leaf-CU. For intra coding, a video encoder maycalculate a residual value for each leaf-TU using the intra predictionmode, as a difference between the portion of the CU corresponding to theTU and the original block. A TU is not necessarily limited to the sizeof a PU. Thus, TUs may be larger or smaller than a PU. For intra coding,a PU may be collocated with a corresponding leaf-TU for the same CU. Insome examples, the maximum size of a leaf-TU may correspond to the sizeof the corresponding leaf-CU.

Moreover, TUs of leaf-CUs may also be associated with respectivequadtree data structures, referred to as residual quadtrees (RQTs). Thatis, a leaf-CU may include a quadtree indicating how the leaf-CU ispartitioned into TUs. The root node of a TU quadtree generallycorresponds to a leaf-CU, while the root node of a CU quadtree generallycorresponds to a treeblock (or LCU). TUs of the RQT that are not splitare referred to as leaf-TUs. In general, this disclosure uses the termsCU and TU to refer to leaf-CU and leaf-TU, respectively, unless notedotherwise.

A video sequence typically includes a series of video frames orpictures. A group of pictures (GOP) generally comprises a series of oneor more of the video pictures. A GOP may include syntax data in a headerof the GOP, a header of one or more of the pictures, or elsewhere, thatdescribes a number of pictures included in the GOP. Each slice of apicture may include slice syntax data that describes an encoding modefor the respective slice. Video encoder 20 typically operates on videoblocks within individual video slices in order to encode the video data.A video block may correspond to a coding node within a CU. The videoblocks may have fixed or varying sizes, and may differ in size accordingto a specified coding standard.

As an example, the HM supports prediction in various PU sizes. Assumingthat the size of a particular CU is 2N×2N, the HM supportsintra-prediction in PU sizes of 2N×2N or N×N, and inter-prediction insymmetric PU sizes of 2N×2N, 2N×N, N×2N, or N×N. The HM also supportsasymmetric partitioning for inter-prediction in PU sizes of 2N×nU,2N×nD, nL×2N, and nR×2N. In asymmetric partitioning, one direction of aCU is not partitioned, while the other direction is partitioned into 25%and 75%. The portion of the CU corresponding to the 25% partition isindicated by an “n” followed by an indication of “Up”, “Down,” “Left,”or “Right.” Thus, for example, “2N×nU” refers to a 2N×2N CU that ispartitioned horizontally with a 2N×0.5N PU on top and a 2N×1.5N PU onbottom.

In this disclosure, “N×N” and “N by N” may be used interchangeably torefer to the pixel dimensions of a video block in terms of vertical andhorizontal dimensions, e.g., 16×16 pixels or 16 by 16 pixels. Ingeneral, a 16×16 block will have 16 pixels in a vertical direction(y=16) and 16 pixels in a horizontal direction (x=16). Likewise, an N×Nblock generally has N pixels in a vertical direction and N pixels in ahorizontal direction, where N represents a nonnegative integer value.The pixels in a block may be arranged in rows and columns. Moreover,blocks need not necessarily have the same number of pixels in thehorizontal direction as in the vertical direction. For example, blocksmay comprise N×M pixels, where M is not necessarily equal to N.

Following intra-predictive or inter-predictive coding using the PUs of aCU, video encoder 20 may calculate residual data for the TUs of the CU.The PUs may comprise syntax data describing a method or mode ofgenerating predictive pixel data in the spatial domain (also referred toas the pixel domain) and the TUs may comprise coefficients in thetransform domain following application of a transform, e.g., a discretecosine transform (DCT), an integer transform, a wavelet transform, or aconceptually similar transform to residual video data. The residual datamay correspond to pixel differences between pixels of the unencodedpicture and prediction values corresponding to the PUs. Video encoder 20may form the TUs including the residual data for the CU, and thentransform the TUs to produce transform coefficients for the CU.

Following any transforms to produce transform coefficients, videoencoder 20 may perform quantization of the transform coefficients.Quantization generally refers to a process in which transformcoefficients are quantized to possibly reduce the amount of data used torepresent the coefficients, providing further compression. Thequantization process may reduce the bit depth associated with some orall of the coefficients. For example, an n-bit value may be rounded downto an m-bit value during quantization, where n is greater than m.

Following quantization, the video encoder may scan the transformcoefficients, producing a one-dimensional vector from thetwo-dimensional matrix including the quantized transform coefficients.The scan may be designed to place higher energy (and therefore lowerfrequency) coefficients at the front of the array and to place lowerenergy (and therefore higher frequency) coefficients at the back of thearray. In some examples, video encoder 20 may utilize a predefined scanorder to scan the quantized transform coefficients to produce aserialized vector that can be entropy encoded. In other examples, videoencoder 20 may perform an adaptive scan. After scanning the quantizedtransform coefficients to form a one-dimensional vector, video encoder20 may entropy encode the one-dimensional vector, e.g., according tocontext-adaptive variable length coding (CAVLC), context-adaptive binaryarithmetic coding (CABAC), syntax-based context-adaptive binaryarithmetic coding (SBAC), Probability Interval Partitioning Entropy(PIPE) coding or another entropy encoding methodology. Video encoder 20may also entropy encode syntax elements associated with the encodedvideo data for use by video decoder 30 in decoding the video data.

To perform CABAC, video encoder 20 may assign a context within a contextmodel to a symbol to be transmitted. The context may relate to, forexample, whether neighboring values of the symbol are non-zero or not.To perform CAVLC, video encoder 20 may select a variable length code fora symbol to be transmitted. Codewords in VLC may be constructed suchthat relatively shorter codes correspond to more probable symbols, whilelonger codes correspond to less probable symbols. In this way, the useof VLC may achieve a bit savings over, for example, using equal-lengthcodewords for each symbol to be transmitted. The probabilitydetermination may be based on a context assigned to the symbol.

In accordance with the techniques of this disclosure, a video coder,such as video encoder 20 or video decoder 30, may determine a codingmode used to encode the video data. The coding mode may be one of alossy coding mode or a lossless coding mode. The video coder maydetermine a color-space transform process dependent on the coding modeused to encode the video data. The video coder may apply the color-spacetransform process in encoding the video data. In decoding the videodata, independent of whether the coding mode is the lossy coding mode orthe lossless coding mode, the video coder may apply the same color-spaceinverse transform process in a decoding loop of the encoding process.

A video coder, such as video encoder 20 or video decoder 30, may performany of the techniques as described with relation to FIGS. 1-9. By usingthe same color-space inverse transform matrix, a video decoder may beable to more efficiently decode video data when color-spacetransformation is used. In different instances, it may be more efficientfor a video encoder to use a lossy coding mode. In other instances, itmay be more efficient for a video decoder to use a lossless coding mode.For higher picture quality, a lossless coding mode may be implemented onthe decoding side, and a lossless coding matrix may be used on thedecoder side regardless of whether the video data is coded with a lossycoding mode or a lossless coding mode. As such, it may add to theefficiency of a video decoder to implement the same lossless color-spaceinverse transform matrix regardless of whether the video data is codedwith a lossy coding mode or a lossless coding mode, removing the step ofdetermining whether the video data is coded with a lossy coding mode ora lossless coding mode, thereby increasing the overall coding efficiencyof the system and reducing energy consumption.

A variety of syntax elements may be used in alignment with techniques ofthe current disclosure. These syntax elements may include:

Descriptor    seq_parameter_set_rbsp( ) {     sps_video_parameter_set_idu(4)     sps_max_sub_layers_minus1 u(3)     sps_temporal_id_nesting_flagu(1)     profile_tier_level( sps_max_sub_layers_minus1 )    ...    vui_parameters_present_flag u(1)     if( vui_parameters_present_flag)      vui_parameters( )     sps_extension_present_flag u(1)     if(sps_extension_present_flag ) {      for( i = 0; i < 1; i++)      sps_extension_flag[ i ] u(1)      sps_extension_7bits u(7)     if( sps_extension_flag[ 0 ] ) {      transform_skip_rotation_enabled_flag u(1)      transform_skip_context_enabled_flag u(1)      intra_block_copy_enabled_flag u(1)      implicit_rdpcm_enabled_flag u(1)       explicit_rdpcm_enabled_flagu(1)       extended_precision_processing_flag u(1)      intra_smoothing_disabled_flag u(1)      high_precision_offsets_enabled_flag u(1)      fast_rice_adaptation_enabled_flag u(1)      cabac_bypass_alignment_enabled_flag u(1)      color_transform_enabled_flag (new) u(1)      }      if(sps_extension_7bits )       while( more_rbsp_data( ) )       sps_extension_data_flag u(1)     }     rbsp_trailing_bits( )    }coding_unit( x0, y0, log2CbSize ) {  if( transquant_bypass_enabled_flag)   cu_transquant_bypass_flag ae(v)  if( slice_type != I )  cu_skip_flag[ x0 ][ y0 ] ae(v)  nCbS = ( 1 << log2CbSize )  if(cu_skip_flag[ x0 ][ y0 ] )   prediction_unit( x0, y0, nCbS, nCbS )  else{   if( intra_block_copy_enabled_flag )    intra_bc_flag[ x0 ][ y0 ]ae(v)   if( slice_type != I && !intra_bc_flag[ x0 ][ y0 ] )   pred_mode_flag ae(v)   if( CuPredMode[ x0 ][ y0 ] != MODE_INTRA | |intra_bc_flag[ x0 ][ y0 ] | |    log2CbSize == MinCbLog2SizeY )   part_mode ae(v)   if( CuPredMode[ x0 ][ y0 ] == MODE_INTRA ) {    if(PartMode == PART_2Nx2N && pcm_enabled_flag &&     !intra_bc_flag[ x0 ][y0 ] &&     log2CbSize >= Log2MinIpcmCbSizeY &&     log2CbSize <=Log2MaxIpcmCbSizeY )     pcm_flag[ x0 ][ y0 ] ae(v)    if( pcm_flag[ x0][ y0 ] ) {     while( !byte_aligned( ) )      pcm_alignment_zero_bitf(1)     pcm_sample( x0, y0, log2CbSize )    } else if( intra_bc_flag[x0 ][ y0 ] ) {     mvd_coding( x0, y0, 2)     if( PartMode == PART_2NxN)      mvd_coding( x0, y0 + ( nCbS / 2 ), 2)     else if( PartMode ==PART_Nx2N )      mvd_coding( x0 + ( nCbS / 2 ), y0, 2)     else if(PartMode == PART_NxN ) {      mvd_coding( x0 + ( nCbS / 2 ), y0, 2)     mvd_coding( x0, y0 + ( nCbS / 2 ), 2)      mvd_coding( x0 + ( nCbS/ 2 ), y0 + ( nCbS / 2 ), 2)     }    } else {     pbOffset = ( PartMode== PART_NxN ) ? ( nCbS / 2) : nCbS     for( j = 0; j < nCbS; j = j +pbOffset )      for( i = 0; i <nCbS; i = i + pbOffset )      prev_intra_luma_pred_flag[ x0 + i ][ y0 + j ] ae(v)     for( j =0; j < nCbS; j = j + pbOffset )      for( i = 0; i < nCbS; i = i +pbOffset )       if( prev_intra_luma_pred_flag[ x0 +i ][ y0 + j ] )       mpm_idx[ x0 + i ][ y0 + j ] ae(v)       else       rem_intra_luma_pred_mode[ x0 + i ][ y0 + j ] ae(v)     if(ChromaArrayType == 3 )      for( j = 0; j < nCbS; j = j + pbOffset )      for( i = 0; i < nCbS; i = i + pbOffset )       intra_chroma_pred_mode[ x0 + i ][ y0 + j ] ae(v)     else if(ChromaArrayType != 0 )      intra_chroma_pred_mode[ x0 ][ y0 ] ae(v)   }   } else { ...   }   if( !pcm_flag[ x0 ][ y0 ] ) {    if(CuPredMode[ x0 ][ y0 ] != MODE_INTRA &&     !( PartMode == PART_2Nx2N &&merge_flag[ x0 ][ Y0 ] ) | |     ( CuPredMode[ x0 ][ y0 ] == MODE_INTRA&& intra_bc_flag[ x0 ][ y0 ] ) )     rqt_root_cbf ae(v)    if(rqt_root_cbf ) {     if( color_transform_enabled_flag ) (new)     color_transform_flag[ x0 ][ y0 ] (new) ae(v)     MaxTrafoDepth = (CuPredMode[ x0 ][ y0 ] == MODE_INTRA ? (max_transform_hierarchy_depth_intra + IntraSplitFlag ) :max_transform_hierarchy_depth_inter )     transform_tree( x0, y0, x0,y0, log2CbSize, 0, 0 )    }   }  } }

When the syntax element color_transform_enabled_flag is equal to 1,in-loop color-space transform process may be invoked in the decodingprocess. When the syntax element color_transform_enabled_flag is equalto 0, in-loop color-space transform may not be applied. When the syntaxelement is not present, the value of the syntax elementcolor_transform_enabled_flag may be inferred to be equal to 0.

When the syntax element color_transform_flag[x0][y0] is equal to 1, thecurrent coding unit may be coded with color-space transform. When thesyntax element color_transform_flag[x0][y0] is equal to 0, the currentcoding unit is coded without color-space transform. When the syntaxelement is not present, the value of the syntax elementcolor_transform_flag may be inferred to be equal to 0. The array indicesx0 and y0 may specify the location (x0, y0) of a top-left luma sample ofthe considered coding block relative to the top-left luma sample of thepicture.

In some examples, video coder, such as video encoder 20 or video decoder30, may determine whether to use color-space conversion for a codingunit. The video coder may set a value of a syntax element of the codingunit to indicate the use of color-space conversion. The video coder mayapply a color-space transform matrix to a residual block of the codingunit. The video coder may decode the syntax element of the coding unit,wherein the syntax element indicates whether the coding unit was encodedusing color-space conversion. The video coder may determine whether avalue of the syntax element indicates that the coding unit was encodedusing color-space conversion. The video coder may apply a color-spaceinverse transform matrix to a residual block of the coding unit inresponse to determining that the syntax element indicates that thecoding unit was coded using color-space conversion.

In one example, for intra-coded CUs, a flag may be directly signaled.Alternatively, for intra-coded CUs, a flag may be signaled only when theCU is not I-PCM mode. In another example, for inter-coded CUs and/orIntra BC-coded CUs, a flag may be signaled only when there are non-zerocoefficients in the current CU, i.e. the rqt_root_cbf is equal to 1. Inanother example, the flag is not signaled when the CU is coded withpalette mode. In all above examples, when the decoded color transformflag is equal to 0, or the flag is not present in the bit stream for oneCU, the color-space transform process may be skipped.

Furthermore, one flag in either sequence parameter set (SPS)/pictureparameter set (PPS)/slice header can be signaled to control the usage ofcolor-space transform. When the flag in SPS/PPS/slice header is equal to0, the signaling of CU-level flag may be skipped in all the CUs in thecorresponding sequence/picture/slice, respectively. Alternatively, thecolor-space transform may be performed in PU-level or TU-level whereineach PU/TU has a flag to indicate the usage of color-space transform.

In one example, a modified YCoCg transform may be applied in theencoding and decoding process. The modified YCoCg transform may definedas follows:

${{{Forward}{\text{:}\mspace{14mu}\begin{bmatrix}Y \\{Co} \\{Cg}\end{bmatrix}}} = {\begin{bmatrix}1 & 2 & 1 \\2 & 0 & {- 2} \\{- 1} & 2 & {- 1}\end{bmatrix}\begin{bmatrix}R \\G \\B\end{bmatrix}}},\begin{matrix}{{Inverse}\text{:}} & {{{temp} = {Y - {Cg}}};} \\\; & {{{G = \left( {Y + {Cg} + {offset}} \right)}\operatorname{>>}2};} \\\; & {{{B = \left( {{temp} - {Co} + {offset}} \right)}\operatorname{>>}2};}\end{matrix}$

R=(temp+Co+offset)>>2; wherein the offset is equal to 2.

Alternatively, the modified YCoCg transform may be defined as follows:

${{Forward}{\text{:}\mspace{14mu}\begin{bmatrix}Y \\{Co} \\{Cg}\end{bmatrix}}} = {\begin{bmatrix}{1/2} & 1 & {1/2} \\1 & 0 & {- 1} \\{{- 1}/2} & 1 & {{- 1}/2}\end{bmatrix}\begin{bmatrix}R \\G \\B\end{bmatrix}}$ $\begin{matrix}{{Inverse}\text{:}} & {{{temp} = {Y - {Cg}}};} \\\; & {{{G = \left( {Y + {Cg} + {offset}} \right)}\operatorname{>>}1};} \\\; & {{{B = \left( {{temp} - {Co} + {offset}} \right)}\operatorname{>>}1};} \\\; & {{{R = \left( {{temp} + {Co} + {offset}} \right)}\operatorname{>>}1};{{wherein}\mspace{14mu} {the}\mspace{14mu} {offset}\mspace{14mu} {is}}} \\\; & {{equal}\mspace{14mu} {to}\mspace{14mu} 1\mspace{14mu} {or}\mspace{14mu} 0.}\end{matrix}$

The corresponding quantization parameter used by CUs or blocks which arecoded with color transform may be inferred to be equal to (dQP+2), whilethe one used by CUs or blocks without color transform may be inferred tobe equal to dQP. Simultaneously, the bit-depth may be further increasedby 1 in both quantization and transform processes.

Alternatively, two steps forward/inverse transform are applied with theoriginal YCoCg transform unchanged plus a normalization process. For theforward transform, the original YCoCg forward transform is firstlyapplied. Then, for each component i, i.e., Y, Co and Cg, the componentis reset to (i*forward_factor+offset)>>BIT_PRECISION whereinBIT_PRECISION is an unsigned integer and forward_factor is dependent onBIT_PRECISION. In one example, forward_factor is equal to1/√6*(1<<BITS_TRANS)+0.5, BIT_PRECISION is equal to 15, offset is equalto (1<<(BIT_PRECISION−1)).

For the inverse transform, the original YCoCg inverse transform isfirstly applied. Then, for each component i, i.e., Y, Co and Cg, thecomponent is reset to (i*backward_factor+offset)>>BIT_PRECISION whereinBIT_PRECISION is the same as used in the forward transform, andbackward_factor is dependent on BIT_PRECISION. In one example,backward_factor is equal to √6/4*(1<<BITS_TRANS)+0.5), offset is equalto (1<<(BIT_PRECISION−1)).

Alternatively/furthermore, the CU-level flag may be signaled only whenat least one of the coded block flags in three color components (i.e.,cbf_luma, cbf_cb and cbf_cr) is equal to 1. Alternatively, the modifiedresidual after color-space transform may be further modified to makesure the range of residual in CUs or blocks with color-space transformis the same as that of residual in CUs/blocks without color-spacetransform. In one example, a clip operation is applied.

Color-space transform matrix may be independent from the reconstructedpixels. Instead, it may be dependent on the lossy or lossless codingmode. In one example, when CU is coded with lossy mode, YCoCg may beapplied while YCoCg-R is applied when the CU is coded with losslessmode. Moreover, when YCoCg-R is applied, the bit depth of Co and Cgcomponents may be increased by 1. In another example, the transformmatrix can be dependent on the intra, inter/Intra BC modes. In thiscase, a predefined matrix for each mode may be specified both at theencoder and decoder and the same matrix may be used both at the encoderand decoder according to the coding mode when CU-level flag is 1.Furthermore, the CU-level flag may be signaled only when at least one ofthe coded block flags in three color components (i.e., cbf_luma, cbf_cband cbf_cr) is equal to 1.

Techniques of the current disclosure may also include a transform matrixderivation and signaling method, such as in frame-level. In one example,for each frame, a transform matrix may be derived based on thestatistics across the color components in the original image. Thetransform matrix can be coded into a bitstream and directly transmittedto the decoder. Alternatively, transform matrix prediction betweenconsecutively coded frames may be applied. For example, one flag may betransmitted to indicate whether the matrix is the same as that used inthe previous frame. Alternatively, a transform matrix could be derivedbased on a set of original frames and signaled in the bitstream.

In another example, a set of transform matrices are derived and signaledin the high-level syntax, such as PPS. In one example, the image isclassified into multiple regions based on the characteristics, and foreach region, a transform matrix is derived. The derived matrices can becoded and signaled in the high-level syntax. The index of the selectedtransform matrix is further signaled in CU/TU/PU level. Alternatively,the index of the selected transform matrix is signaled in slice headeror for each tile region. Alternatively, the transform matrix may bederived in slice header or for each tile region.

When the bit-depth of luma and chroma components are different, thebit-depth of all color components may firstly be modified to be same,then the color transform may be applied afterward. Alternatively, thebitstream may conform to a constraint that, when the bit-depth of lumaand chroma components are different in the coded bitstream, the colortransform shall be disabled (i.e. color_transform_enabled_flag equal to0).

Different QPs may be applied to CUs/blocks which are coded with orwithout color transform, and/or the bit-depth used in quantization andtransform process can be modified because of such a non-normalized colortransform. In one example, when the above modified YCoCg transform isused, the following steps (i.e., Scaling, transformation and arrayconstruction process prior to deblocking filter process) are furthermodified based on color_transform_flag.

In one example, when the modified YCoCg transform, as described above,is used, the corresponding quantization parameter derivation process andinverse transform process are modified accordingly. Inputs to thisprocess may include a luma location (xCb, yCb) specifying the top-leftsample of the current luma coding block relative to the top-left lumasample of the current picture. In this process, the variable QpY, theluma quantization parameter Qp′Y, and the chroma quantization parametersQp′Cb and Qp′Cr may be derived. The luma location (xQg, yQg) may specifythe top-left luma sample of the current quantization group relative tothe top left luma sample of the current picture. The horizontal andvertical positions xQg and yQg may be set equal to xCb−(xCb&((1<<Log2MinCuQpDeltaSize)−1)) and yCb−(yCb&((1<<Log 2MinCuQpDeltaSize)−1)),respectively. The luma size of a quantization group, Log2MinCuQpDeltaSize, may determine the luma size of the smallest areainside a coding tree block that shares the same qPY_PRED.

The variable QpY may be derived as follows:

QpY=((qPY_PRED+CuQpDeltaVal+52+2*QpBdOffsetY)%(52+QpBdOffsetY))−QpBdOffsetY

The luma quantization parameter Qp′Y may be derived as follows:

Qp′Y=QpY+QpBdOffsetY

When the syntax element ChromaArrayType is not equal to 0, the followingmay apply:

The variables qPiCb and qPiCr may be derived as follows:

qPiCb=Clip3(−QpBdOffsetC,57,QpY+pps _(—) cb _(—) qp_offset+slice_(—) cb_(—) qp_offset+CuQpAdjValCb)

qPiCr=Clip3(−QpBdOffsetC,57,QpY+pps _(—) cr _(—) qp_offset+slice_(—) cr_(—) qp_offset+CuQpAdjValCr)

If the syntax element ChromaArrayType is equal to 1, the variables qPCband qPCr may be set equal to the value of QpC as specified in the belowtable based on the index qPi equal to qPiCb and qPiCr, respectively.Otherwise, the variables qPCb and qPCr are set equal to Min(qPi, 51),based on the index qPi equal to qPiCb and qPiCr, respectively.

TABLE 2 qPi <30 3 3 3 3 3 3 3 3 3 3 4 4 4 4 >43 0 1 2 3 4 5 6 7 8 9 0 12 3 Qpc = qPi 2 3 3 3 3 3 3 3 3 3 3 3 3 3 = qPi − 6 9 0 1 2 3 3 4 4 5 56 6 7 7

The chroma quantization parameters for the Cb and Cr components, Qp′Cband Qp′Cr, may be derived as follows:

Qp′Cb=qPCb+QpBdOffsetC

Qp′Cr=qPCr+QpBdOffsetC

When color_transform_flag is equal to 1, the following may apply:

Qp′Y=(Qp′Y+8)

When ChromaArrayType≠0,Qp′Cb=(Qp′cb+8) and Qp′Cr=(Qp′cr+8)

BitDepthY=(BitDepthY+2)

BitDepthC=(BitDepthC+2)

Inputs to this process may include a luma location (xTbY, yTbY)specifying the top-left sample of the current luma transform blockrelative to the top left luma sample of the current picture, a variablenTbS specifying the size of the current transform block, a variable cIdxspecifying the colour component of the current block, and a variable qPspecifying the quantization parameter. Output of this process mayinclude the (nTbS)×(nTbS) array d of scaled transform coefficients withelements d[x][y].

The variables log 2TransformRange, bdShift, coeffMin and coeffMax may bederived as follows:

When color_transform_flag=1, the following applies:

Co effCTMinY=−(1<<(extended_precision_processing_flag?

Max(15,BitDepthY+6):15))

Co effCTMinC=−(1<<(extended_precision_processing_flag?

Max(15,BitDepthC+6):15))

Co effCTMaxY=(1<<(extended_precision_processing_flag?

Max(15,BitDepthY+6):15))−1

Co effCTMaxC=(1<<(extended_precision_processing_flag?

Max(15,BitDepthC+6):15))−1

If cIdx=0,

log 2TransformRange=extended_precision_processing_flag ?

Max(15,BitDepthY+6):15

bdShift=BitDepthY+Log 2(nTbS)+10−log 2TransformRange

coeffMin=(color_transform_flag?Co effCTMinY:Co effMinY)

coeffMax=(color_transform_flag?Co effCTMaxY:Co effMaxY)

Otherwise,

log 2TransformRange=extended_precision_processing_flag?

Max(15,BitDepthC+6):15

bdShift=BitDepthC+Log 2(nTbS)+10−log 2TransformRange

coeffMin=(color_transform_flag?Co effCTMinC:Co effMinC)

coeffMax=(color_transform_flag?Co effCTMaxC:Co effMaxC)

The list levelScale[ ] may be specified as levelScale[k]={40, 45, 51,57, 64, 72} with k=0 . . . 5.

For the derivation of the scaled transform coefficients d[x][y] with x=0. . . nTbS−1, y=0 . . . nTbS−1, the following may apply:

The scaling factor m[x][y] may be derived as follows:

If one or more of the following conditions are true, m[x][y] is setequal to 16:

-   -   scaling_list_enabled_flag=0.    -   transform_skip_flag[xTbY][yTbY]=1 and nTbS>4.

Otherwise the following applies:

m[x][y]=ScalingFactor[sizeId][matrixId][x][y]  (8-283)

When the syntax element sizeId is specified for the size of thequantization matrix equal to (nTbS)×(nTbS) and matrixId is specified inTable 7-4 for sizeId, CuPredMode[xTbY][yTbY], and cIdx, respectively,then the scaled transform coefficient d[x][y] may be derived as follows:

d[x][y]=Clip3(coeffMin,coeffMax,((TransCoeffLevel[xTbY][yTbY][cIdx][x][y]*m[x][y]*levelScale[qP%6]<<(qP/6))+(1<<(bdShift−1)))>>bdShift)

When color_transform_flag is equal to 1, the following may apply:

BitDepthY=BitDepthY−2

BitDepthC=BitDepthC−2

In one example, when color-space transform is applied to intra modes,the residue is derived in the converted color-space domain. That is,before invoking the intra sample prediction process, the neighboringpixels of the current CU may be first converted to another sub-optimalcolor-space with a modified forward YCoCg or YCoCg-R transform. Themodified neighboring pixels may then be used to derive the predictor ofthe current CU. The residual (i.e., prediction error) is derived fromthe current CU and the current CU's neighboring pixels in thesub-optimal domain. The residual is coded in the same way asconventional coding flow, such as inter-component residual prediction,transform, quantization and entropy coding. After entropy coding, thetransform coefficients may be further modified with the inverse YCoCg orYCoCg-R transform. The modified transform coefficients may then be addedto the predictor to derive the reconstructed pixels of the current CU.After the reconstruction process is invoked, the inverse YCoCg orYCoCg-R transform may be applied to the modified neighboring pixels.Therefore, at the decoder side, before invoking the reconstructionprocess, one additional process may be applied wherein the inversecolor-space transform is applied to the derived transform coefficients.

When color-space transform is applied to intra modes, instead ofgenerating the residue by subtracting the predictor from the currentblock in the converted color domain, the residue may be generated usingthe pixels before color-space transform, followed by the color-spacetransform. In this case, the luma and chroma intra modes can be set tothe identical mode. Alternatively, the signaling of the chroma mode maybe skipped. Alternatively, the color transform flag may be signaled onlywhen the luma and chroma intra modes are same.

As described above, in some examples, the lossless and lossy codingmethods may share the same matrix, for example, YCoCg-R. Additionally oralternatively, when the YCoCg-R transform is applied to lossy coding,the bit-depth of chroma components of blocks with color transform may beincreased by 1 compared to blocks without color transform. The lumacomponent QP of blocks with color transform may be equal to that ofblocks without color transform minus 4. In one example, the two chromacomponents QP of blocks with color transform may be equal to chroma/lumacomponent QP of blocks without color transform plus 2. In one example,the Cg chroma components QP of blocks with color transform may be equalto the luma/chroma component QP of blocks without color transform plus2. The Co chroma components QP of blocks with color transform may beequal to the luma/chroma component QP of blocks without color transformplus 3.

In such examples, when YCoCg-R is used for both lossy and lossless mode,if current block is lossy coded, the bit-depth of luma and chroma may bethe same for those blocks coded without enabling adaptive colortransform. In this case, when lossy coding is applied, after the forwardtransform of YCoCg-R, the Co and Cg components may be scaled by N-bitright shift to reduce the increased bit-depth due to the forward YCoCg-Rtransform and make the bit-depth precision the same as the bit-depthprecision of the Y component. In addition, before performing the reverseYCoCg-R transform, Co and Cg component may be modified with N-bit leftshift. In one example, N is equal to 1.

In one example, it may be assumed that the input bit-depth of luma andchroma components are the same. For the lossy coding mode, shiftingoperations may be applied to the two chroma components (i.e., Cg, Co)after the forward transform, and before the inverse transform. In oneexample, the following process is applied in order:

1. Forward YCoCg-R is unchanged:

Co=R−B

t=B+[Co/2]

Cg=G−t′

Y=t+[Cg/2]

2. If current block is coded in lossy mode, the following may furtherapply:

Cg=Cg>>1;

Co=Co>>1;

In another example, an offset may be considered in the right shiftprocess. For example, the above highlighted equations could be replacedby:

Cg=(Cg+1)>>1;

Co=(Co+1)>>1;

Before invoking the reverse YCoCg-R transform, the following may apply:

If current block is coded in lossy mode, the following may apply:

Cg=Cg<<1;

Co=Co<<1;

And the inverse YCoCg-R may remain unchanged:

t=Y−[Cg/2]

G=Cg+t

B=t−[Co/2]

R=B+Co

In such examples, a residual modification process for transform blocksusing adaptive colour transform may be invoked when ChromaArrayType isequal to 3. Inputs to this process may include a variable blkSizespecifying the block size, an (blkSize)×(blkSize) array of luma residualsamples rY with elements rY[x][y], an (blkSize)×(blkSize) array ofchroma residual samples rCb with elements rCb[x][y], and an(blkSize)×(blkSize) array of chroma residual samples rCr with elementsrCr[x][y]. Outputs to this process may include a modified(blkSize)×(blkSize) array r_(Y) of luma residual samples, a modified(blkSize)×(blkSize) array r_(Cb) of chroma residual samples, and amodified (blkSize)×(blkSize) array r_(Cr) of chroma residual samples.

The (blkSize)×(blkSize) arrays of residual samples r_(Y), r_(Cb) andr_(Cr) with x=0 . . . blkSize−1, y=0 . . . blkSize−1 may be modified asfollows:

If cu_transquant_bypass_flag=0,r _(Cb) [x][y]=r _(Cb) [x][y]−1 and r_(Cr) [x][y]=r _(Cr) [x][y]−1

tmp=r _(Y) [x][y]−(r _(Cb) [x][y]>>1)

r _(Y) [x][y]=tmp+r _(Cb) [x][y]

r _(Cb) [x][y]=tmp−(r _(Cr) [x][y]>>1)

r _(Cr) [x][y]=r _(Cb) [x][y]+r _(Cr) [x][y]

Alternatively, ‘if cu_transquant_bypass_flag is equal to 0,r_(Cb)[x][y]=r_(Cb)[x][y]<<1 and r_(Cr)[x][y]=r_(Cr)[x][y]<<1’ could bereplaced by ‘r_(Cb)[x][y]=r_(Cb)[x][y]<<(1−cu_transquant_bypass_flag)and r_(Cr)[x][y]=r_(Cr)[x] [y]−(1−cu_transquant_bypass_flag)’.

In another example of a lossy coding method and a lossless coding methodsharing a color-transform matrix, the input bit-depth of luma and chromacomponents may be different. In such an example, when the input bitdepths of luma and chroma components are different and YCoCg-R is usedfor both lossy and lossless coding modes, before the inverse transform,at least one of the values of Y, Co, Cg component may first be shifted Nbits to make all three components have same bit-depth precision. Inaddition, one more bit may be shifted to the two chroma components(i.e., Co, and Cg). At least one of the prediction values of all threecomponents may be modified to have the same bit-depth precision beforeinvoking forward YCoCg-R transform. And after the forward transform, thetwo chroma components may be right shifted with 1 bit. For losslesscoding modes, the different bit-depth may not be considered and,therefore, the adaptive color-space transform may be disabled. In oneexample, the bitstream may include a constraint that, when the bit-depthof luma and chroma components are different in the coded bitstream, thecolor transform shall be disabled (i.e. color_transform_enabled_flagequal to 0).

In this example, a residual modification process for transform blocksusing adaptive colour transform may be invoked when ChromaArrayType isequal to 3. Inputs to this process may include a variable blkSizespecifying the block size, a (blkSize)×(blkSize) array of luma residualsamples rY with elements rY[x][y], a (blkSize)×(blkSize) array of chromaresidual samples rCb with elements rCb[x][y], and a (blkSize)×(blkSize)array of chroma residual samples rCr with elements rCr[x][y]. Outputs tothis process may include a modified (blkSize)×(blkSize) array r_(Y) ofluma residual samples, a modified (blkSize)×(blkSize) array r_(Cb) ofchroma residual samples, and a modified (blkSize)×(blkSize) array r_(Cr)of chroma residual samples.

The variables deltaBD_(Y) and deltaBD_(C) may be derived as follows:

BitDepthMax=Max(BitDepthY,BitDepthC)

deltaBDY=cu_transquant_bypass_flag?0:BitDepthMax−BitDepthY

deltaBDC=cu_transquant_bypass_flag?0:BitDepthMax−BitDepthC

OY=cu_transquant_bypass_flag∥(BitDepthMax==BitDepthY)?0:1<<(deltaBDY−1)

OC=cu_transquant_bypass_flag∥(BitDepthMax==BitDepthc)?0:1<<(deltaBDc−1)

The (blkSize)×(blkSize) arrays of residual samples r_(Y), r_(Cb) andr_(Cr)

with x=0 . . . blkSize−1, y=0 . . . blkSize−1 may be modified asfollows:Residual samples rY[x][y], rCb[x][y] and rCr[x][y] may be modified asfollows:

rY[x][y]=rY[x][y]<<deltaBDY

rCb[x][y]=rCb[x][y]<<(deltaBDC+1−cu_transquant_bypass_flag)

rCr[x][y]=rCr[x][y]<<(deltaBDC+1−cu_transquant_bypass_flag)

tmp=rY[x][y]−(rCb[x][y]>>1)

rY[x][y]=tmp+rCb[x][y]

rCb[x][y]=tmp−(rCr[x][y]>>1)

rCr[x][y]=rCb[x][y]+rCr[x][y]

rY[x][y]=(rY[x][y]+OY)>>deltaBDY

rCb[x][y]=(rCb[x][y]+Oc)>>deltaBDC

rCr[x][y]=(rCr[x][y]+Oc)>>deltaBDC

In the above examples, the function Max may be used to derive the largervalue between two variables. Alternatively, at least one of the roundingoffsets O_(Y) and O_(c) may be set equal to 0.

Alternatively, even for lossless coding, when the bit-depth of luma andchroma components are different, the components may be shifted to thesame bit-depth precision, if needed. At the encoder side, after theforward transform, there may be no need to shift back to the originalbit-depth precision. In other words, the coded residual of the threecomponents may be of the same bit-depth to make sure it is losslesscoding. Different from lossy coding, the inputs may not be modifiedbefore invoking backward YCoCg-R transform for lossless coding. Theright shift may still be needed to make sure the outputs are in the samebit-depth as the original inputs.

In this example, a residual modification process for transform blocksusing adaptive colour transform may be invoked when ChromaArrayType isequal to 3. Inputs to this process may include a variable blkSizespecifying the block size, a (blkSize)×(blkSize) array of luma residualsamples rY with elements rY[x][y], a (blkSize)×(blkSize) array of chromaresidual samples rCb with elements rCb[x][y], and a (blkSize)×(blkSize)array of chroma residual samples rCr with elements rCr[x][y]. Outputs tothis process may include a modified (blkSize)×(blkSize) array r_(Y) ofluma residual samples, a modified (blkSize)×(blkSize) array r_(Cb) ofchroma residual samples, and an modified (blkSize)×(blkSize) arrayr_(Cr) of chroma residual samples.

The variables deltaBD_(Y) and deltaBD_(C) may be derived as follows:

BitDepthMax=Max(BitDepthY,BitDepthC)

deltaBDY=BitDepthMax−BitDepthY

deltaBDC=BitDepthMax−BitDepthC

OY=(BitDepthMax==BitDepthY)?0:1<<(deltaBDY−1)

OC=(BitDepthMax==BitDepthc)?0:1<<(deltaBDc−1)

The (blkSize)×(blkSize) arrays of residual samples r_(Y), r_(Cb) andr_(Cr)

with x=0 . . . blkSize−1, y=0 . . . blkSize−1 may be modified asfollows:When cu_transquant_bypass_flag is equal to 0, residual samples rY[x][y],rCb[x][y] and rCr[x][y] may be modified as follows:

rY[x][y]=rY[x][y]<<deltaBDY

rCb[x][y]=rCb[x][y]<<(deltaBDC+1−cu_transquant_bypass_flag)

rCr[x][y]=rCr[x][y]<<(deltaBDC+1−cu_transquant_bypass_flag)

tmp=rY[x][y]−(rCb[x][y]>>1)

rY[x][y]=tmp+rCb[x][y]

rCb[x][y]=tmp−(rCr[x][y]>>1)

rCr[x][y]=rCb[x][y]+rCr[x][y]

rY[x][y]=(rY[x][y]+OY)>>deltaBDY

rCb[x][y]=(rCb[x][y]+0c)>>deltaBDC

rCr[x][y]=(rCr[x][y]+0c)>>deltaBDC

Alternatively, one of O_(Y) and O_(C) may be equal to 0.

Video encoder 20 may further send syntax data, such as block-basedsyntax data, frame-based syntax data, and GOP-based syntax data, tovideo decoder 30, e.g., in a frame header, a block header, a sliceheader, or a GOP header. The GOP syntax data may describe a number offrames in the respective GOP, and the frame syntax data may indicate anencoding/prediction mode used to encode the corresponding frame.

Video encoder 20 and video decoder 30 each may be implemented as any ofa variety of suitable encoder or decoder circuitry, as applicable, suchas one or more microprocessors, digital signal processors (DSPs),application specific integrated circuits (ASICs), field programmablegate arrays (FPGAs), discrete logic circuitry, software, hardware,firmware or any combinations thereof. Each of video encoder 20 and videodecoder 30 may be included in one or more encoders or decoders, eitherof which may be integrated as part of a combined video encoder/decoder(CODEC). A device including video encoder 20 and/or video decoder 30 maycomprise an integrated circuit, a microprocessor, and/or a wirelesscommunication device, such as a cellular telephone.

FIG. 2 is a block diagram illustrating an example of video encoder 20that may implement techniques for encoding video blocks using acolor-space conversion process. Video encoder 20 may perform intra- andinter-coding of video blocks within video slices. Intra-coding relies onspatial prediction to reduce or remove spatial redundancy in videowithin a given video frame or picture. Inter-coding relies on temporalprediction to reduce or remove temporal redundancy in video withinadjacent frames or pictures of a video sequence. Intra-mode (I mode) mayrefer to any of several spatial based coding modes. Inter-modes, such asuni-directional prediction (P mode) or bi-prediction (B mode), may referto any of several temporal-based coding modes.

As shown in FIG. 2, video encoder 20 receives a current video blockwithin a video frame to be encoded. In the example of FIG. 2, videoencoder 20 includes mode select unit 40, reference picture memory 64,summer 50, transform processing unit 52, quantization unit 54, andentropy encoding unit 56. Mode select unit 40, in turn, includes motioncompensation unit 44, motion estimation unit 42, intra-prediction unit46, and partition unit 48. For video block reconstruction, video encoder20 also includes inverse quantization unit 58, inverse transform unit60, and summer 62. A deblocking filter (not shown in FIG. 2) may also beincluded to filter block boundaries to remove blockiness artifacts fromreconstructed video. If desired, the deblocking filter would typicallyfilter the output of summer 62. Additional filters (in loop or postloop) may also be used in addition to the deblocking filter. Suchfilters are not shown for brevity, but if desired, may filter the outputof summer 50 (as an in-loop filter).

During the encoding process, video encoder 20 receives a video frame orslice to be coded. The frame or slice may be divided into multiple videoblocks. Motion estimation unit 42 and motion compensation unit 44perform inter-predictive coding of the received video block relative toone or more blocks in one or more reference frames to provide temporalprediction. Intra-prediction unit 46 may alternatively performintra-predictive coding of the received video block relative to one ormore neighboring blocks in the same frame or slice as the block to becoded to provide spatial prediction. Video encoder 20 may performmultiple coding passes, e.g., to select an appropriate coding mode foreach block of video data.

Moreover, partition unit 48 may partition blocks of video data intosub-blocks, based on evaluation of previous partitioning schemes inprevious coding passes. For example, partition unit 48 may initiallypartition a frame or slice into LCUs, and partition each of the LCUsinto sub-CUs based on rate-distortion analysis (e.g., rate-distortionoptimization). Mode select unit 40 may further produce a quadtree datastructure indicative of partitioning of an LCU into sub-CUs. Leaf-nodeCUs of the quadtree may include one or more PUs and one or more TUs.

Mode select unit 40 may select one of the coding modes, intra or inter,e.g., based on error results, and provides the resulting intra- orinter-coded block to summer 50 to generate residual block data and tosummer 62 to reconstruct the encoded block for use as a reference frame.Mode select unit 40 also provides syntax elements, such as motionvectors, intra-mode indicators, partition information, and other suchsyntax information, to entropy encoding unit 56.

Motion estimation unit 42 and motion compensation unit 44 may be highlyintegrated, but are illustrated separately for conceptual purposes.Motion estimation, performed by motion estimation unit 42, is theprocess of generating motion vectors, which estimate motion for videoblocks. A motion vector, for example, may indicate the displacement of aPU of a video block within a current video frame or picture relative toa predictive block within a reference frame (or other coded unit)relative to the current block being coded within the current frame (orother coded unit). A predictive block is a block that is found toclosely match the block to be coded, in terms of pixel difference, whichmay be determined by sum of absolute difference (SAD), sum of squaredifference (SSD), or other difference metrics. In some examples, videoencoder 20 may calculate values for sub-integer pixel positions ofreference pictures stored in reference picture memory 64. For example,video encoder 20 may interpolate values of one-quarter pixel positions,one-eighth pixel positions, or other fractional pixel positions of thereference picture. Therefore, motion estimation unit 42 may perform amotion search relative to the full pixel positions and fractional pixelpositions and output a motion vector with fractional pixel precision.

Motion estimation unit 42 calculates a motion vector for a PU of a videoblock in an inter-coded slice by comparing the position of the PU to theposition of a predictive block of a reference picture. The referencepicture may be selected from a first reference picture list (List 0) ora second reference picture list (List 1), each of which identify one ormore reference pictures stored in reference picture memory 64. Motionestimation unit 42 sends the calculated motion vector to entropyencoding unit 56 and motion compensation unit 44.

Motion compensation, performed by motion compensation unit 44, mayinvolve fetching or generating the predictive block based on the motionvector determined by motion estimation unit 42. Again, motion estimationunit 42 and motion compensation unit 44 may be functionally integrated,in some examples. Upon receiving the motion vector for the PU of thecurrent video block, motion compensation unit 44 may locate thepredictive block to which the motion vector points in one of thereference picture lists. Summer 50 forms a residual video block bysubtracting pixel values of the predictive block from the pixel valuesof the current video block being coded, forming pixel difference values,as discussed below. In general, motion estimation unit 42 performsmotion estimation relative to luma components, and motion compensationunit 44 uses motion vectors calculated based on the luma components forboth chroma components and luma components. Mode select unit 40 may alsogenerate syntax elements associated with the video blocks and the videoslice for use by video decoder 30 in decoding the video blocks of thevideo slice.

Intra-prediction unit 46 may intra-predict a current block, as analternative to the inter-prediction performed by motion estimation unit42 and motion compensation unit 44, as described above. In particular,intra-prediction unit 46 may determine an intra-prediction mode to useto encode a current block. In some examples, intra-prediction unit 46may encode a current block using various intra-prediction modes, e.g.,during separate encoding passes, and intra-prediction unit 46 (or modeselect unit 40, in some examples) may select an appropriateintra-prediction mode to use from the tested modes.

For example, intra-prediction unit 46 may calculate rate-distortionvalues using a rate-distortion analysis for the various testedintra-prediction modes, and select the intra-prediction mode having thebest rate-distortion characteristics among the tested modes.Rate-distortion analysis generally determines an amount of distortion(or error) between an encoded block and an original, unencoded blockthat was encoded to produce the encoded block, as well as a bitrate(that is, a number of bits) used to produce the encoded block.Intra-prediction unit 46 may calculate ratios from the distortions andrates for the various encoded blocks to determine which intra-predictionmode exhibits the best rate-distortion value for the block.

After selecting an intra-prediction mode for a block, intra-predictionunit 46 may provide information indicative of the selectedintra-prediction mode for the block to entropy encoding unit 56. Entropyencoding unit 56 may encode the information indicating the selectedintra-prediction mode. Video encoder 20 may include in the transmittedbitstream configuration data, which may include a plurality ofintra-prediction mode index tables and a plurality of modifiedintra-prediction mode index tables (also referred to as codeword mappingtables), definitions of encoding contexts for various blocks, andindications of a most probable intra-prediction mode, anintra-prediction mode index table, and a modified intra-prediction modeindex table to use for each of the contexts.

Video encoder 20 forms a residual video block by subtracting theprediction data from mode select unit 40 from the original video blockbeing coded. Summer 50 represents the component or components thatperform this subtraction operation. Transform processing unit 52 appliesa transform, such as a discrete cosine transform (DCT) or a conceptuallysimilar transform, to the residual block, producing a video blockcomprising residual transform coefficient values. Transform processingunit 52 may perform other transforms which are conceptually similar toDCT. Wavelet transforms, integer transforms, sub-band transforms orother types of transforms could also be used. In any case, transformprocessing unit 52 applies the transform to the residual block,producing a block of residual transform coefficients. The transform mayconvert the residual information from a pixel value domain to atransform domain, such as a frequency domain. Transform processing unit52 may send the resulting transform coefficients to quantization unit54. Quantization unit 54 quantizes the transform coefficients to furtherreduce bit rate. The quantization process may reduce the bit depthassociated with some or all of the coefficients. The degree ofquantization may be modified by adjusting a quantization parameter. Insome examples, quantization unit 54 may then perform a scan of thematrix including the quantized transform coefficients. Alternatively,entropy encoding unit 56 may perform the scan.

Following quantization, entropy encoding unit 56 entropy codes thequantized transform coefficients. For example, entropy encoding unit 56may perform context adaptive variable length coding (CAVLC), contextadaptive binary arithmetic coding (CABAC), syntax-based context-adaptivebinary arithmetic coding (SBAC), probability interval partitioningentropy (PIPE) coding or another entropy coding technique. In the caseof context-based entropy coding, context may be based on neighboringblocks. Following the entropy coding by entropy encoding unit 56, theencoded bitstream may be transmitted to another device (e.g., videodecoder 30) or archived for later transmission or retrieval.

In accordance with techniques of this disclosure, entropy encoding unit56 of video encoder 20 may perform one or more techniques of the currentdisclosure. For example, entropy encoding unit 56 of video encoder 20may determine a coding mode used to encode the video data. The codingmode may be one of a lossy coding mode or a lossless coding mode.Entropy encoding unit 56 may further determine a color-space transformprocess dependent on the coding mode used to encode the video data.Entropy encoding unit 56 of video encoder 20 may further apply thecolor-space transform process to the video data. Entropy encoding unit56 of video encoder 20 may further apply a color-space inverse transformprocess in a decoding loop of the encoding process. In the techniques ofthis disclosure, the color-space inverse transform process isindependent of whether the coding mode is the lossy coding mode or thelossless coding mode.

Inverse quantization unit 58 and inverse transform unit 60 apply inversequantization and inverse transformation, respectively, to reconstructthe residual block in the pixel domain, e.g., for later use as areference block. Motion compensation unit 44 may calculate a referenceblock by adding the residual block to a predictive block of one of theframes of reference picture memory 64. Motion compensation unit 44 mayalso apply one or more interpolation filters to the reconstructedresidual block to calculate sub-integer pixel values for use in motionestimation. Summer 62 adds the reconstructed residual block to themotion compensated prediction block produced by motion compensation unit44 to produce a reconstructed video block for storage in referencepicture memory 64. The reconstructed video block may be used by motionestimation unit 42 and motion compensation unit 44 as a reference blockto inter-code a block in a subsequent video frame.

In this manner, entropy encoding unit 56 of video encoder 20 may performone or more techniques of the current disclosure. For example, entropyencoding unit 56 of video encoder 20 may perform one or more techniquesof the current disclosure. For example, entropy encoding unit 56 ofvideo encoder 20 may determine a coding mode used to encode the videodata. The coding mode may be one of a lossy coding mode or a losslesscoding mode. Entropy encoding unit 56 may further determine acolor-space transform process dependent on the coding mode used toencode the video data. Entropy encoding unit 56 of video encoder 20 mayfurther apply the color-space transform process to the video data.Entropy encoding unit 56 of video encoder 20 may further apply acolor-space inverse transform process in a decoding loop of the encodingprocess. In the techniques of this disclosure, the color-space inversetransform process is independent of whether the coding mode is the lossycoding mode or the lossless coding mode.

In some examples, the coding mode may be the lossy coding mode. In suchexamples, the color-space transform process may be a YCoCg matrix.Entropy encoding unit 56 of video encoder 20 may modify a Co componentand a CG component of the YCoCg matrix with an N-bit left shift beforeapplying the color-space inverse transform process in the decoding loopof the encoding process. In some examples, N may equal 1.

In other examples, the coding mode may be the lossless coding mode. Insuch examples, the color-space transform process may be a YCoCg-Rmatrix. Entropy encoding unit 56 of video encoder 20 may increase a bitdepth of a Co component and a Cg component of the YCoCg-R matrix by 1.

In either of the two above examples, the color-space inverse transformprocess may be a lossless color-space inverse transform process. In suchexamples, the lossless color-space inverse transform process maycomprise a YCoCg-R matrix.

In some examples, entropy encoding unit 56 of video encoder 20 mayfurther determine to use color-space conversion for encoding the videodata. In doing so, entropy encoding unit 56 of video encoder 20 may seta value of a syntax element of the video data to indicate the use ofcolor-space conversion in response to determining to use color-spaceconversion for the coding unit. In some examples, the syntax elementcomprises a one-bit flag. In some examples, the syntax element issignaled when the coding unit is coded using a mode other thanintra-pulse code modulation (IPCM) mode. In other examples, the syntaxelement is signaled only when there are non-zero coefficients in atransform unit of the coding unit. In some examples, a value of 1 forthe syntax element indicates that the coding unit was encoded usingcolor-space conversion.

In some examples, the syntax element may not be signaled. For instance,the syntax element may not be signaled when the coding unit is intracoded and when a luma prediction mode and a chroma prediction mode of aprediction unit within the coding unit are different. In anotherexample, the syntax element may not be signaled when the coding unit iscoded with a palette mode.

In some examples, the syntax element is a first syntax element and thevideo data is a first set of video data. In such examples, entropyencoding unit 56 of video encoder 20 may determine a value of a paletteindex for a first pixel in a second coding unit of a second set of videodata. Entropy encoding unit 56 of video encoder 20 may further determinevalues of palette indexes for one or more next pixels in a scanningorder immediately succeeding the first pixel. Determining the values ofthe palette indexes may comprise determining the values of the paletteindexes until a pixel has a palette index with a value different thanthe value of the palette index for the first pixel. Entropy encodingunit 56 of video encoder 20 may further determine a number of paletteindex values determined for the next pixels. Based on the number ofpalette index values, entropy encoding unit 56 of video encoder 20 mayencode the palette index using either a first mode or a second mode.When the number of palette index values is greater than one, entropyencoding unit 56 of video encoder 20 may set a value of a second syntaxelement to indicate that the first mode was used to encoding the paletteindex and set a value of a third syntax element equal to the number ofpalette index values. When the number of palette index values is lessthan or equal to one, entropy encoding unit 56 of video encoder 20 mayset the value of the second syntax element to indicate that the secondmode was used to encoding the palette index. In some examples, the firstmode is a run mode, and the second mode is a pixel mode.

In some examples, encoding the syntax element may comprise entropyencoding unit 56 of video encoder 20 encoding data of a supplementalenhancement information (SEI) message that indicates whether the codingunit was encoded using color-space conversion.

FIG. 3 is a block diagram illustrating an example of video decoder 30that may implement techniques for decoding video blocks, some of whichwere encoded using a color-space conversion process. In the example ofFIG. 3, video decoder 30 includes an entropy decoding unit 70, motioncompensation unit 72, intra prediction unit 74, inverse quantizationunit 76, inverse transformation unit 78, reference picture memory 82 andsummer 80. Video decoder 30 may, in some examples, perform a decodingpass generally reciprocal to the encoding pass described with respect tovideo encoder 20 (FIG. 2). Motion compensation unit 72 may generateprediction data based on motion vectors received from entropy decodingunit 70, while intra-prediction unit 74 may generate prediction databased on intra-prediction mode indicators received from entropy decodingunit 70.

During the decoding process, video decoder 30 receives an encoded videobitstream that represents video blocks of an encoded video slice andassociated syntax elements from video encoder 20. Entropy decoding unit70 of video decoder 30 entropy decodes the bitstream to generatequantized coefficients, motion vectors or intra-prediction modeindicators, and other syntax elements. Entropy decoding unit 70 forwardsthe motion vectors to and other syntax elements to motion compensationunit 72. Video decoder 30 may receive the syntax elements at the videoslice level and/or the video block level.

In accordance with techniques of this disclosure, entropy decoding unit70 of video decoder 30 may perform one or more techniques of the currentdisclosure. For example, entropy decoding unit 70 of video decoder 30may receive a first encoded block of video data. The first encoded blockof video data was encoded using a lossy coding mode and a firstcolor-space transform process. Entropy decoding unit 70 of video decoder30 may further receive a second encoded block of video data. The secondencoded block of video data was encoded using a lossless coding mode anda second color-space transform process. Entropy decoding unit 70 ofvideo decoder 30 may further a color-space inverse transform process tothe first encoded block of video data. Entropy decoding unit 70 of videodecoder 30 may further apply the same color-space inverse transformprocess to the second encoded block of video data. On the decoder side,there may be no need to perform a color-space forward transform process,regardless of the coding mode. In some examples, the color-space inversetransform process may be fixed.

When the video slice is coded as an intra-coded (I) slice, intraprediction unit 74 may generate prediction data for a video block of thecurrent video slice based on a signaled intra prediction mode and datafrom previously decoded blocks of the current frame or picture. When thevideo frame is coded as an inter-coded (i.e., B, P or GPB) slice, motioncompensation unit 72 produces predictive blocks for a video block of thecurrent video slice based on the motion vectors and other syntaxelements received from entropy decoding unit 70. The predictive blocksmay be produced from one of the reference pictures within one of thereference picture lists. Video decoder 30 may construct the referenceframe lists, List 0 and List 1, using default construction techniquesbased on reference pictures stored in reference picture memory 82.Motion compensation unit 72 determines prediction information for avideo block of the current video slice by parsing the motion vectors andother syntax elements, and uses the prediction information to producethe predictive blocks for the current video block being decoded. Forexample, motion compensation unit 72 uses some of the received syntaxelements to determine a prediction mode (e.g., intra- orinter-prediction) used to code the video blocks of the video slice, aninter-prediction slice type (e.g., B slice, P slice, or GPB slice),construction information for one or more of the reference picture listsfor the slice, motion vectors for each inter-encoded video block of theslice, inter-prediction status for each inter-coded video block of theslice, and other information to decode the video blocks in the currentvideo slice.

Motion compensation unit 72 may also perform interpolation based oninterpolation filters. Motion compensation unit 72 may use interpolationfilters as used by video encoder 20 during encoding of the video blocksto calculate interpolated values for sub-integer pixels of referenceblocks. In this case, motion compensation unit 72 may determine theinterpolation filters used by video encoder 20 from the received syntaxelements and use the interpolation filters to produce predictive blocks.

Inverse quantization unit 76 inverse quantizes, i.e., de-quantizes, thequantized transform coefficients provided in the bitstream and decodedby entropy decoding unit 70. The inverse quantization process mayinclude use of a quantization parameter QP_(Y) calculated by videodecoder 30 for each video block in the video slice to determine a degreeof quantization and, likewise, a degree of inverse quantization thatshould be applied.

Inverse transform unit 78 applies an inverse transform, e.g., an inverseDCT, an inverse integer transform, or a conceptually similar inversetransform process, to the transform coefficients in order to produceresidual blocks in the pixel domain.

After motion compensation unit 72 generates the predictive block for thecurrent video block based on the motion vectors and other syntaxelements, video decoder 30 forms a decoded video block by summing theresidual blocks from inverse transform unit 78 with the correspondingpredictive blocks generated by motion compensation unit 72. Summer 80represents the component or components that perform this summationoperation. If desired, a deblocking filter may also be applied to filterthe decoded blocks in order to remove blockiness artifacts. Other loopfilters (either in the coding loop or after the coding loop) may also beused to smooth pixel transitions, or otherwise improve the videoquality. The decoded video blocks in a given frame or picture are thenstored in reference picture memory 82, which stores reference picturesused for subsequent motion compensation. Reference picture memory 82also stores decoded video for later presentation on a display device,such as display device 32 of FIG. 1.

In this manner, entropy decoding unit 70 of video decoder 30 may performone or more techniques of the current disclosure. For example, entropydecoding unit 70 of video decoder 30 may receive a first encoded blockof video data. The first encoded block of video data was encoded using alossy coding mode and a first color-space transform process. Entropydecoding unit 70 of video decoder 30 may further receive a secondencoded block of video data. The second encoded block of video data wasencoded using a lossless coding mode and a second color-space transformprocess. Entropy decoding unit 70 of video decoder 30 may further acolor-space inverse transform process to the first encoded block ofvideo data. Entropy decoding unit 70 of video decoder 30 may furtherapply the same color-space inverse transform process to the secondencoded block of video data. On the decoder side, there may be no needto perform a color-space forward transform process, regardless of thecoding mode. In some examples, the color-space inverse transform processmay be fixed. In some examples, the blocks of video data may be codingunits.

In some examples, entropy decoding unit 70 of video decoder 30 mayfurther modify one or more components of the first encoded block ofvideo data with an N-bit right shift or an N-bit left shift. In someexamples, N may be equal to 1. In some examples, the one or morecomponents of the first encoded block of video data may be two chromacomponents.

In some examples, the first color-space transform process comprises aYCoCg matrix. In further examples, the second color-space transformprocess comprises a YCoCg-R matrix. In either example, the color-spaceinverse transform process may comprise a lossless color-space inversetransform process. In some examples, the lossless color-space inversetransform process comprises a YCoCg-R matrix.

In some examples, entropy decoding unit 70 of video decoder 30 maydecode a syntax element of a coding unit of video data. The syntaxelement may indicate whether the coding unit was encoded usingcolor-space conversion. In some examples, the syntax element maycomprise a one-bit flag. In some examples, the coding unit is coded in amode other than intra-pulse code modulation (IPCM) mode and the syntaxelement is signaled only for coding units using a mode other than theIPCM mode. In some examples, the syntax element indicates that thecoding unit was encoded using color-space conversion when there arenon-zero coefficients in a transform unit of the coding unit. In someexamples, a value of 1 for the syntax element indicates that the codingunit was encoded using color-space conversion. Entropy decoding unit 70of video decoder 30 may further determine whether a value of the syntaxelement indicates that the coding unit was encoded using color-spaceconversion. In response to determining that the syntax element indicatesthat the coding unit was coded using color-space conversion, entropydecoding unit 70 of video decoder 30 may apply the color-space inversetransform process.

In some examples, the syntax element may indicate that color-spaceconversion was not used for encoding the coding unit. For instance, thesyntax element may indicate that color-space conversion was not used forencoding the coding unit when the coding unit is intra coded and when aluma prediction mode and a chroma prediction mode of a prediction unitwithin the coding unit are different. In another example, the syntaxelement may indicate that color-space conversion was not used forencoding the coding unit when the coding unit is coded with a palettemode. In these examples, the syntax element may not be present in areceived bitstream that comprises the video data, and decoding thesyntax element may comprise inferring the value of the syntax element.

In some examples, the syntax element is a first syntax element and thevideo data is a first set of video data. In such examples, entropydecoding unit 70 of video decoder 30 may further determine a value of asecond syntax element of a second set of video data. The second syntaxelement may indicate whether a palette mode was used for encoding thesecond set of video data. In response to the second syntax elementindicating that the palette mode was used for encoding the video data,entropy decoding unit 70 of video decoder 30 may determine a value of athird syntax element. The third syntax element may indicate whether afirst mode or a second mode is used for decoding a palette index for apixel in the coding unit. Based on the determined value of the secondsyntax element, entropy decoding unit 70 of video decoder 30 may decodethe palette index using either the first mode or the second mode. Whenusing the first mode, entropy decoding unit 70 of video decoder 30 maydetermine a value of the palette index, determine a value of a fourthsyntax element that indicates a number of pixels in a scanning orderimmediately succeeding the pixel currently being decoded, and duplicatethe result of determining the value of the palette index for the next Npixels in the scanning order, with N equaling the value of the fourthsyntax element. In some examples, the first mode is a run mode. Whenusing the second mode, entropy decoding unit 70 of video decoder 30 maydetermine the value of the palette index and output a pixel sample valuefor the pixel, where the pixel sample value is equal to the value of thepalette index. In some examples, the second mode is a pixel mode.

In some examples, decoding the syntax element comprises entropy decodingunit 70 of video decoder 30 being configured to decode data of asupplemental enhancement information (SEI) message that indicateswhether the coding unit was encoded using color-space conversion.

FIG. 4 is a conceptual diagram illustrating the 35 HEVC prediction modesaccording to one or more techniques of the current disclosure. In thecurrent HEVC, for the luma component of each Prediction Unit (PU), anintra prediction method is utilized with 33 angular prediction modes(indexed from 2 to 34), DC mode (indexed with 1) and Planar mode(indexed with 0), as described with respect to FIG. 4.

In addition to the above 35 intra modes, one more mode, named ‘I-PCM’,is also employed by HEVC. In I-PCM mode, prediction, transform,quantization, and entropy coding are bypassed while the predictionsamples are coded by a predefined number of bits. The main purpose ofthe I-PCM mode is to handle the situation when the signal cannot beefficiently coded by other modes.

FIG. 5 is a conceptual diagram illustrating spatial neighboring motionvector candidates for merge and advanced motion vector prediction (AMVP)modes according to one or more techniques of the current disclosure. Asdescribed with respect to FIG. 5, spatial MV candidates are derived fromthe neighboring blocks shown on FIG. 5 for a specific PU (PU0), althoughthe methods generating the candidates from the blocks differ for mergeand AMVP modes.

In merge mode, up to four spatial MV candidates may be derived with theorders showed on FIG. 5( a) with numbers, and the order is thefollowing: left (0), above (1), above right (2), below left (3), andabove left (4), as shown in FIG. 5( a).

In AMVP mode, the neighboring blocks are divided into two groups: leftgroup consisting of the block 0 and 1, and above group consisting of theblocks 2, 3, and 4 as shown on FIG. 5( b). For each group, the potentialcandidate in a neighboring block referring to the same reference pictureas that indicated by the signaled reference index has the highestpriority to be chosen to form a final candidate of the group. It ispossible that all neighboring blocks don't contain a motion vectorpointing to the same reference picture. Therefore, if such a candidatecannot be found, the first available candidate will be scaled to formthe final candidate, thus the temporal distance differences can becompensated.

FIG. 6 is a conceptual diagram illustrating an intra-block copy (BC)example according to one or more techniques of the current disclosure.As described with respect to FIG. 6, the Intra Block-Copy (BC) has beenincluded in RExt. An example of Intra BC is shown as in FIG. 6, whereinthe current CU is predicted from an already decoded block of the currentpicture/slice. The current Intra BC block size can be as large as a CUsize, which ranges from 8×8 to 64×64, although some applications,further constrains may apply in addition.

FIG. 7 is a conceptual diagram illustrating an example of a target blockand reference sample for an intra 8×8 block, according to one or moretechniques of the current disclosure. As described below with respect toFIG. 7, a transform matrix is derived from the reference sample values.Different reference samples are utilized for the intra case and intercase. For the case of intra block, target block and reference samplesare shown in FIG. 7. In this figure, target block consists of 8×8crosshatched samples and references are striped and dotted samples.

For the case of inter block, reference samples for the matrix derivationis the same as that for motion compensation. In order to realize theshift operation, reference samples in the AMP block is sub-sampled suchthat the number of samples becomes the power-of-two. For example, thenumber of reference samples in a 12×16 block is reduced to ⅔.

According to some techniques of the current disclosure, the color-spacetransform process may be applied. In such examples, there is no need tosignal whether the transform process is invoked or not. In addition,both the encoder and decoder sides may derive the transform matrix withthe same method to avoid the overhead for signaling the transformmatrix.

FIG. 8 is a flowchart illustrating an example method for encoding acurrent block. The current block may comprise a current CU or a portionof the current CU. Although described with respect to video encoder 20(FIGS. 1 and 2), it should be understood that other devices may beconfigured to perform a method similar to that of FIG. 8.

In this example, video encoder 20 initially predicts the current block(150). For example, video encoder 20 may calculate one or moreprediction units (PUs) for the current block. Video encoder 20 may thencalculate a residual block for the current block, e.g., to produce atransform unit (TU) (152). To calculate the residual block, videoencoder 20 may calculate a difference between the original, uncodedblock and the predicted block for the current block. Entropy encodingunit 56 of video encoder 20 may determine a coding mode used to encodethe video data (154). The coding mode may be one of a lossy coding modeor a lossless coding mode. Entropy encoding unit 56 may furtherdetermine a color-space transform process dependent on the coding modeused to encode the video data (156). Entropy encoding unit 56 of videoencoder 20 may further apply the color-space transform process to thevideo data (158). Video encoder 20 may then transform and quantizecoefficients of the residual block (160). Next, video encoder 20 mayscan the quantized transform coefficients of the residual block (162).During the scan, or following the scan, video encoder 20 may entropyencode the coefficients (164). For example, video encoder 20 may encodethe coefficients using CAVLC or CABAC. Video encoder 20 may then outputthe entropy coded data of the block (166). Entropy encoding unit 56 ofvideo encoder 20 may further apply a color-space inverse transformprocess in a decoding loop of the encoding process (168). In thetechniques of this disclosure, the color-space inverse transform processis independent of whether the coding mode is the lossy coding mode orthe lossless coding mode.

In some examples, the coding mode may be the lossy coding mode. In suchexamples, the color-space transform process may be a YCoCg matrix.Entropy encoding unit 56 of video encoder 20 may modify a Co componentand a CG component of the YCoCg matrix with an N-bit left shift beforeapplying the color-space inverse transform process in the decoding loopof the encoding process. In some examples, N may equal 1.

In other examples, the coding mode may be the lossless coding mode. Insuch examples, the color-space transform process may be a YCoCg-Rmatrix. Entropy encoding unit 56 of video encoder 20 may increase a bitdepth of a Co component and a Cg component of the YCoCg-R matrix by 1.

In either of the two above examples, the color-space inverse transformprocess may be a lossless color-space inverse transform process. In suchexamples, the lossless color-space inverse transform process maycomprise a YCoCg-R matrix.

In some examples, entropy encoding unit 56 of video encoder 20 mayfurther determine to use color-space conversion for encoding the videodata. In doing so, entropy encoding unit 56 of video encoder 20 may seta value of a syntax element of the video data to indicate the use ofcolor-space conversion in response to determining to use color-spaceconversion for the coding unit. In some examples, the syntax elementcomprises a one-bit flag. In some examples, the syntax element issignaled when the coding unit is coded using a mode other thanintra-pulse code modulation (IPCM) mode. In other examples, the syntaxelement is signaled only when there are non-zero coefficients in atransform unit of the coding unit. In some examples, a value of 1 forthe syntax element indicates that the coding unit was encoded usingcolor-space conversion.

In some examples, the syntax element may not be signaled. For instance,the syntax element may not be signaled when the coding unit is intracoded and when a luma prediction mode and a chroma prediction mode of aprediction unit within the coding unit are different. In anotherexample, the syntax element may not be signaled when the coding unit iscoded with a palette mode. In these examples, the syntax element may notbe present in a received bitstream that comprises the video data, anddecoding the syntax element may comprise inferring the value of thesyntax element.

In some examples, the syntax element is a first syntax element and thevideo data is a first set of video data. In such examples, entropyencoding unit 56 of video encoder 20 may determine a value of a paletteindex for a first pixel in a second coding unit of a second set of videodata. Entropy encoding unit 56 of video encoder 20 may further determinevalues of palette indexes for one or more next pixels in a scanningorder immediately succeeding the first pixel. Determining the values ofthe palette indexes may comprise determining the values of the paletteindexes until a pixel has a palette index with a value different thanthe value of the palette index for the first pixel. Entropy encodingunit 56 of video encoder 20 may further determine a number of paletteindex values determined for the next pixels. Based on the number ofpalette index values, entropy encoding unit 56 of video encoder 20 mayencode the palette index using either a first mode or a second mode.When the number of palette index values is greater than one, entropyencoding unit 56 of video encoder 20 may set a value of a second syntaxelement to indicate that the first mode was used to encoding the paletteindex and set a value of a third syntax element equal to the number ofpalette index values. When the number of palette index values is lessthan or equal to one, entropy encoding unit 56 of video encoder 20 mayset the value of the second syntax element to indicate that the secondmode was used to encoding the palette index. In some examples, the firstmode is a run mode, and the second mode is a pixel mode.

In some examples, encoding the syntax element may comprise entropyencoding unit 56 of video encoder 20 encoding data of a supplementalenhancement information (SEI) message that indicates whether the codingunit was encoded using color-space conversion.

FIG. 9 is a flowchart illustrating an example method for decoding acurrent block of video data. The current block may comprise a current CUor a portion of the current CU. Although described with respect to videodecoder 30 (FIGS. 1 and 3), it should be understood that other devicesmay be configured to perform a method similar to that of FIG. 9.

Entropy decoding unit 70 of video decoder 30 may receive a first encodedblock of video data (196). The first encoded block of video data wasencoded using a lossy coding mode and a first color-space transformprocess. Entropy decoding unit 70 of video decoder 30 may furtherreceive a second encoded block of video data (198). The second encodedblock of video data was encoded using a lossless coding mode and asecond color-space transform process.

Video decoder 30 may predict the current block (200), e.g., using anintra- or inter-prediction mode to calculate a predicted block for thecurrent block. Video decoder 30 may also receive entropy coded data forthe current block, such as entropy coded data for coefficients of aresidual block corresponding to the current block (202). Video decoder30 may entropy decode the entropy coded data to reproduce coefficientsof the residual block (204). Video decoder 30 may then inverse scan thereproduced coefficients (206), to create a block of quantized transformcoefficients. Video decoder 30 may then inverse transform and inversequantize the coefficients (208). Entropy decoding unit 70 of videodecoder 30 may decode a syntax element for the current block (210).

Entropy decoding unit 70 of video decoder 30 may further apply acolor-space inverse transform process to the first encoded block ofvideo data (212). Entropy decoding unit 70 of video decoder 30 mayfurther apply the same color-space inverse transform process to thesecond encoded block of video data (214). Video decoder 30 mayultimately decode the current block by combining the predicted block andthe residual block (216). On the decoder side, there may be no need toperform a color-space forward transform process, regardless of thecoding mode. In some examples, the color-space inverse transform processmay be fixed. In some examples, the blocks of video data may be codingunits.

In some examples, entropy decoding unit 70 of video decoder 30 mayfurther modify one or more components of the first encoded block ofvideo data with an N-bit right shift or an N-bit left shift. In someexamples, N may be equal to 1. In some examples, the one or morecomponents of the first encoded block of video data may be two chromacomponents.

In some examples, the first color-space transform process comprisesapplying a YCoCg matrix. In further examples, the second color-spacetransform process comprises applying a YCoCg-R matrix. In eitherexample, the color-space inverse transform process may comprise alossless color-space inverse transform process. In some examples, thelossless color-space inverse transform process comprises applying aYCoCg-R matrix.

In some examples, entropy decoding unit 70 of video decoder 30 maydecode a syntax element of a coding unit of video data. The syntaxelement may indicate whether the coding unit was encoded usingcolor-space conversion. In some examples, the syntax element maycomprise a one-bit flag. In some examples, the coding unit is coded in amode other than intra-pulse code modulation (IPCM) mode and the syntaxelement is signaled only for coding units using a mode other than theIPCM mode. In some examples, the syntax element indicates that thecoding unit was encoded using color-space conversion when there arenon-zero coefficients in a transform unit of the coding unit. In someexamples, a value of 1 for the syntax element indicates that the codingunit was encoded using color-space conversion. Entropy decoding unit 70of video decoder 30 may further determine whether a value of the syntaxelement indicates that the coding unit was encoded using color-spaceconversion. In response to determining that the syntax element indicatesthat the coding unit was coded using color-space conversion, entropydecoding unit 70 of video decoder 30 may apply the color-space inversetransform process.

In some examples, the syntax element may indicate that color-spaceconversion was not used for encoding the coding unit. For instance, thesyntax element may indicate that color-space conversion was not used forencoding the coding unit when the coding unit is intra coded and when aluma prediction mode and a chroma prediction mode of a prediction unitwithin the coding unit are different. In another example, the syntaxelement may indicate that color-space conversion was not used forencoding the coding unit when the coding unit is coded with a palettemode. In these examples, the received bitstream may not include thesyntax element.

In some examples, the syntax element is a first syntax element and thevideo data is a first set of video data. In such examples, entropydecoding unit 70 of video decoder 30 may further determine a value of asecond syntax element of a second set of video data. The second syntaxelement may indicate whether a palette mode was used for encoding thesecond set of video data. In response to the second syntax elementindicating that the palette mode was used for encoding the video data,entropy decoding unit 70 of video decoder 30 may determine a value of athird syntax element. The third syntax element may indicate whether afirst mode or a second mode is used for decoding a palette index for apixel in the coding unit. Based on the determined value of the secondsyntax element, entropy decoding unit 70 of video decoder 30 may decodethe palette index using either the first mode or the second mode. Whenusing the first mode, entropy decoding unit 70 of video decoder 30 maydetermine a value of the palette index, determine a value of a fourthsyntax element that indicates a number of pixels in a scanning orderimmediately succeeding the pixel currently being decoded, and duplicatethe result of determining the value of the palette index for the next Npixels in the scanning order, with N equaling the value of the fourthsyntax element. In some examples, the first mode is a run mode. Whenusing the second mode, entropy decoding unit 70 of video decoder 30 maydetermine the value of the palette index and output a pixel sample valuefor the pixel, where the pixel sample value is equal to the value of thepalette index. In some examples, the second mode is a pixel mode.

In some examples, decoding the syntax element comprises entropy decodingunit 70 of video decoder 30 being configured to decode data of asupplemental enhancement information (SEI) message that indicateswhether the coding unit was encoded using color-space conversion.

It is to be recognized that depending on the example, certain acts orevents of any of the techniques described herein can be performed in adifferent sequence, may be added, merged, or left out altogether (e.g.,not all described acts or events are necessary for the practice of thetechniques). Moreover, in certain examples, acts or events may beperformed concurrently, e.g., through multi-threaded processing,interrupt processing, or multiple processors, rather than sequentially.

In one or more examples, the functions described may be implemented inhardware, software, firmware, or any combination thereof. If implementedin software, the functions may be stored on or transmitted over as oneor more instructions or code on a computer-readable medium and executedby a hardware-based processing unit. Computer-readable media may includecomputer-readable storage media, which corresponds to a tangible mediumsuch as data storage media, or communication media including any mediumthat facilitates transfer of a computer program from one place toanother, e.g., according to a communication protocol. In this manner,computer-readable media generally may correspond to (1) tangiblecomputer-readable storage media which is non-transitory or (2) acommunication medium such as a signal or carrier wave. Data storagemedia may be any available media that can be accessed by one or morecomputers or one or more processors to retrieve instructions, codeand/or data structures for implementation of the techniques described inthis disclosure. A computer program product may include acomputer-readable medium.

By way of example, and not limitation, such computer-readable storagemedia can comprise RAM, ROM, EEPROM, CD-ROM or other optical diskstorage, magnetic disk storage, or other magnetic storage devices, flashmemory, or any other medium that can be used to store desired programcode in the form of instructions or data structures and that can beaccessed by a computer. Also, any connection is properly termed acomputer-readable medium. For example, if instructions are transmittedfrom a website, server, or other remote source using a coaxial cable,fiber optic cable, twisted pair, digital subscriber line (DSL), orwireless technologies such as infrared, radio, and microwave, then thecoaxial cable, fiber optic cable, twisted pair, DSL, or wirelesstechnologies such as infrared, radio, and microwave are included in thedefinition of medium. It should be understood, however, thatcomputer-readable storage media and data storage media do not includeconnections, carrier waves, signals, or other transitory media, but areinstead directed to non-transitory, tangible storage media. Disk anddisc, as used herein, includes compact disc (CD), laser disc, opticaldisc, digital versatile disc (DVD), floppy disk and Blu-ray disc, wheredisks usually reproduce data magnetically, while discs reproduce dataoptically with lasers. Combinations of the above should also be includedwithin the scope of computer-readable media.

Instructions may be executed by one or more processors, such as one ormore digital signal processors (DSPs), general purpose microprocessors,application specific integrated circuits (ASICs), field programmablelogic arrays (FPGAs), or other equivalent integrated or discrete logiccircuitry. Accordingly, the term “processor,” as used herein may referto any of the foregoing structure or any other structure suitable forimplementation of the techniques described herein. In addition, in someaspects, the functionality described herein may be provided withindedicated hardware and/or software modules configured for encoding anddecoding, or incorporated in a combined codec. Also, the techniquescould be fully implemented in one or more circuits or logic elements.

The techniques of this disclosure may be implemented in a wide varietyof devices or apparatuses, including a wireless handset, an integratedcircuit (IC) or a set of ICs (e.g., a chip set). Various components,modules, or units are described in this disclosure to emphasizefunctional aspects of devices configured to perform the disclosedtechniques, but do not necessarily require realization by differenthardware units. Rather, as described above, various units may becombined in a codec hardware unit or provided by a collection ofinteroperative hardware units, including one or more processors asdescribed above, in conjunction with suitable software and/or firmware.

Various examples of the disclosure have been described. Any combinationof the described systems, operations, or functions is contemplated.These and other examples are within the scope of the following claims.

1. A method of encoding video data in an encoding process, the methodcomprising: determining a coding mode used to encode the video data,wherein the coding mode is one of a lossy coding mode or a losslesscoding mode; determining a color-space transform process dependent onthe coding mode used to encode the video data; applying the color-spacetransform process to the video data; and applying a color-space inversetransform process in a decoding loop of the encoding process, whereinthe color-space inverse transform process is independent of whether thecoding mode is the lossy coding mode or the lossless coding mode.
 2. Themethod of claim 1, wherein the coding mode is the lossy coding mode, andwherein applying the color-space transform process comprises applying aYCoCg matrix.
 3. The method of claim 2, further comprising modifying aCo component and a Cg component of the YCoCg matrix with an N-bit leftshift before applying the color-space inverse transform process in thedecoding loop of the encoding process.
 4. The method of claim 3, whereinN is equal to
 1. 5. The method of claim 1, wherein the coding mode isthe lossless coding mode, and wherein applying the color-space transformprocess comprises applying a YCoCg-R matrix.
 6. The method of claim 5,further comprising increasing a bit depth of a Co component and a Cgcomponent by
 1. 7. The method of claim 1, wherein the color-spaceinverse transform process is a lossless color-space inverse transformprocess.
 8. The method of claim 7, wherein applying the losslesscolor-space inverse transform process comprises applying a YCoCg-Rmatrix.
 9. The method of claim 1, further comprising determining to usecolor-space conversion for encoding the video data, wherein determiningto use color-space conversion for encoding the video data comprises:setting a value of a syntax element that indicates that the video datawas encoded using color-space conversion.
 10. The method of claim 9,wherein the syntax element comprises a one-bit flag.
 11. The method ofclaim 9, wherein the coding unit is coded in a mode other thanintra-pulse code modulation (IPCM) mode, and wherein the syntax elementindicates that the coding unit was encoded using color-space conversionwhen the coding unit is coded using a mode other than intra-pulse codemodulation (IPCM) mode.
 12. The method of claim 9, wherein the syntaxelement indicates that the coding unit was encoded using color-spaceconversion when there are non-zero coefficients in a transform unit ofthe coding unit.
 13. The method of claim 9, wherein the syntax elementis not signaled when the coding unit is intra coded and when a lumaprediction mode and a chroma prediction mode of a prediction unit withinthe coding unit are different.
 14. The method of claim 9, wherein thesyntax element is not signaled when the coding unit is coded with apalette mode.
 15. The method of claim 9, wherein a value of 1 for thesyntax element indicates that color-space conversion is used forencoding the coding unit.
 16. A video encoding device comprising: amemory configured to store video data; and one or more processorsconfigured to: determine a coding mode used to encode the video data,wherein the coding mode is one of a lossy coding mode or a losslesscoding mode; determine a color-space transform process dependent on thecoding mode used to encode the video data; apply the color-spacetransform process to the video data; and apply a color-space inversetransform process in a decoding loop of the encoding process, whereinthe color-space inverse transform process is independent of whether thecoding mode is the lossy coding mode or the lossless coding mode. 17.The video encoding device of claim 16, wherein the coding mode is thelossy coding mode, and wherein applying the color-space transformprocess comprises applying a YCoCg matrix.
 18. The video encoding deviceof claim 17, wherein the one or more processors are further configuredto modify a Co component and a Cg component of the YCoCg matrix with anN-bit left shift before applying the color-space inverse transformprocess in the decoding loop of the encoding process.
 19. The videoencoding device of claim 19, wherein N is equal to
 1. 20. The videoencoding device of claim 16, wherein the coding mode is the losslesscoding mode, and wherein the one or more processors being configured toapply the color-space transform process comprises the one or moreprocessors being configured to apply a YCoCg-R matrix.
 21. The videoencoding device of claim 20, wherein the one or more processors arefurther configured to increase a bit depth of a Co component and a Cgcomponent by
 1. 22. The video encoding device of claim 16, wherein thecolor-space inverse transform process is a lossless color-space inversetransform process.
 23. The video encoding device of claim 22, whereinthe one or more processors being configured to apply the losslesscolor-space inverse transform process comprises the one or moreprocessors being configured to apply a YCoCg-R matrix.
 24. The videoencoding device of claim 16, wherein the one or more processors arefurther configured to determine to use color-space conversion forencoding the video data, wherein the one or more processors beingconfigured to determine to use color-space conversion for encoding thevideo data comprises the one or more processors being configured to: seta value of a syntax element that indicates that the video data wasencoded using color-space conversion.
 25. The video encoding device ofclaim 24, wherein the syntax element comprises a one-bit flag.
 26. Thevideo encoding device of claim 24, wherein the syntax element issignaled when the coding unit is coded using a mode other thanintra-pulse code modulation (IPCM) mode.
 27. The video encoding deviceof claim 24, wherein the syntax element is signaled only when there arenon-zero coefficients in a transform unit of the coding unit.
 28. Thevideo encoding device of claim 24, wherein the syntax element is notsignaled when the coding unit is intra coded and when a luma predictionmode and a chroma prediction mode of a prediction unit within the codingunit are different.
 29. The video encoding device of claim 24, whereinthe syntax element is not signaled when the coding unit is coded with apalette mode.
 30. The video coding device of claim 24, wherein a valueof 1 for the syntax element indicates that the coding unit was encodedusing color-space conversion.
 31. A method of decoding video data, themethod comprising: receiving a first encoded block of video data,wherein the first encoded block of video data was encoded using a lossycoding mode and a first color-space transform process; receiving asecond encoded block of video data, wherein the second encoded block ofvideo data was encoded using a lossless coding mode and a secondcolor-space transform process; applying a color-space inverse transformprocess to the first encoded block of video data; and applying thecolor-space inverse transform process to the second encoded block ofvideo data.
 32. The method of claim 31, further comprising: modifyingone or more components of the first encoded block of video data with anN-bit right shift or an N-bit left shift.
 33. The method of claim 32,wherein N is equal to
 1. 34. The method of claim 32, wherein the one ormore components of the first encoded block of video data comprise twochroma components.
 35. The method of claim 31, wherein the color-spaceinverse transform process is a lossless color-space inverse transformprocess.
 36. The method of claim 35, wherein the lossless color-spaceinverse transform process comprises a YCoCg-R matrix.
 37. The method ofclaim 31, further comprising: decoding a syntax element of a coding unitof video data, wherein the syntax element indicates whether the codingunit was encoded using color-space conversion; determining whether avalue of the syntax element indicates that the coding unit was encodedusing color-space conversion; and in response to determining that thesyntax element indicates that the coding unit was coded usingcolor-space conversion, applying the color-space inverse transformprocess.
 38. The method of claim 37, wherein the syntax elementcomprises a one-bit flag.
 39. The method of claim 37, wherein the codingunit is coded in a mode other than intra-pulse code modulation (IPCM)mode, and wherein the syntax element is signaled only for coding unitsusing a mode other than the IPCM mode.
 40. The method of claim 37,wherein the syntax element indicates that the coding unit was encodedusing color-space conversion when there are non-zero coefficients in atransform unit of the coding unit.
 41. The method of claim 37, whereinthe syntax element indicates that the coding unit was not encoded usingcolor-space conversion when the coding unit is intra coded and when aluma prediction mode and a chroma prediction mode of a prediction unitwithin the coding unit are different, wherein the syntax element is notpresent in a received bitstream that comprises the video data, andwherein decoding the syntax element comprises inferring the value of thesyntax element.
 42. The method of claim 37, wherein the syntax elementindicates that the coding unit was not encoded using color-spaceconversion when the coding unit is coded with a palette mode, whereinthe syntax element is not present in a received bitstream that comprisesthe video data, and wherein decoding the syntax element comprisesinferring the value of the syntax element.
 43. The method of claim 37,wherein a value of 1 for the syntax element indicates that the codingunit was encoded using color-space conversion.
 44. A video decodingdevice comprising: a memory configured to store video data; and one ormore processors configured to: receive a first encoded block of videodata, wherein the first encoded block of video data was encoded using alossy coding mode and a first color-space transform process; receive asecond encoded block of video data, wherein the second encoded block ofvideo data was encoded using a lossless coding mode and a secondcolor-space transform process; apply a color-space inverse transformprocess to the first encoded block of video data; and apply thecolor-space inverse transform process to the second encoded block ofvideo data.
 45. The video decoding device of claim 44, wherein the oneor more processors are further configured to: modify one or morecomponents of the first encoded block of video data with an N-bit rightshift or an N-bit left shift.
 46. The video decoding device of claim 45,wherein N is equal to
 1. 47. The video decoding device of claim 45,wherein the one or more components of the first encoded block of videodata comprise two chroma components.
 48. The video decoding device ofclaim 44, wherein the color-space inverse transform process is alossless color-space inverse transform process.
 49. The video decodingdevice of claim 48, wherein the lossless color-space inverse transformprocess comprises a YCoCg-R matrix.
 50. The video decoding device ofclaim 44, wherein the one or more processors are further configured to:decode a syntax element of a coding unit of video data, wherein thesyntax element indicates whether the coding unit was encoded usingcolor-space conversion; determine whether a value of the syntax elementindicates that the coding unit was encoded using color-space conversion;and in response to determining that the syntax element indicates thatthe coding unit was coded using color-space conversion, apply thecolor-space inverse transform process.
 51. The video decoding device ofclaim 50, wherein the syntax element comprises a one-bit flag.
 52. Thevideo decoding device of claim 50, wherein the coding unit is coded in amode other than intra-pulse code modulation (IPCM) mode, and wherein thesyntax element is signaled only for coding units using a mode other thanthe IPCM mode.
 53. The video decoding device of claim 50, wherein thesyntax element indicates that the coding unit was encoded usingcolor-space conversion when there are non-zero coefficients in atransform unit of the coding unit.
 54. The video decoding device ofclaim 50, wherein the syntax element indicates that the coding unit wasnot encoded using color-space conversion when the coding unit is intracoded and when a luma prediction mode and a chroma prediction mode of aprediction unit within the coding unit are different, wherein the syntaxelement is not present in a received bitstream that comprises the videodata, and wherein decoding the syntax element comprises inferring thevalue of the syntax element.
 55. The video decoding device of claim 50,wherein the syntax element indicates that the coding unit was notencoded using color-space conversion when the coding unit is coded witha palette mode, wherein the syntax element is not present in a receivedbitstream that comprises the video data, and wherein decoding the syntaxelement comprises inferring the value of the syntax element.
 56. Thevideo decoding device of claim 50, wherein a value of 1 for the syntaxelement indicates that the coding unit was encoded using color-spaceconversion.
 57. A video decoding apparatus comprising: means forreceiving a first encoded block of video data, wherein the first encodedblock of video data was encoded using a lossy coding mode and a firstcolor-space transform process; means for receiving a second encodedblock of video data, wherein the second encoded block of video data wasencoded using a lossless coding mode and a second color-space transformprocess; means for applying a color-space inverse transform process tothe first encoded block of video data; and means for applying thecolor-space inverse transform process to the second encoded block ofvideo data.
 58. The video decoding apparatus of claim 57, furthercomprising: means for modifying one or more components of the firstencoded block of video data with an N-bit right shift or an N-bit leftshift.
 59. The video decoding apparatus of claim 58, wherein N is equalto
 1. 60. The video decoding apparatus of claim 58, wherein the one ormore components of the first encoded block of video data comprise twochroma components.
 61. The video decoding apparatus of claim 57, whereinthe color-space inverse transform process is a lossless color-spaceinverse transform process.
 62. The video decoding apparatus of claim 61,wherein the lossless color-space inverse transform process comprises aYCoCg-R matrix.
 63. A computer-readable storage medium comprisinginstructions that, when executed, cause one or more processors of avideo decoding device to: receive a first encoded block of video data,wherein the first encoded block of video data was encoded using a lossycoding mode and a first color-space transform process; receive a secondencoded block of video data, wherein the second encoded block of videodata was encoded using a lossless coding mode and a second color-spacetransform process; apply a color-space inverse transform process to thefirst encoded block of video data; and apply the color-space inversetransform process to the second encoded block of video data.
 64. Thecomputer-readable storage medium of claim 63, wherein the instructionsfurther cause the one or more processors to: modify one or morecomponents of the first encoded block of video data with an N-bit rightshift or an N-bit left shift.
 65. The computer-readable storage mediumof claim 64, wherein N is equal to
 0. 66. The computer-readable storagemedium of claim 64, wherein the one or more components of the firstencoded block of video data comprise two chroma components.
 67. Thecomputer-readable storage medium of claim 63, wherein the color-spaceinverse transform process is a lossless color-space inverse transformprocess.
 68. The computer-readable storage medium of claim 67, whereinthe lossless color-space inverse transform process comprises a YCoCg-Rmatrix.